Skip to content

Instantly share code, notes, and snippets.

@wizlee
Created Jun 13, 2021
Embed
What would you like to do?
angular-marketplace-totorial-main.ts
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { CometChat } from "@cometchat-pro/chat";
import { COMETCHAT_CONSTANTS } from "./CONSTS";
if (environment.production) {
enableProdMode();
}
const appSetting = new CometChat.AppSettingsBuilder()
.subscribePresenceForAllUsers()
.setRegion(COMETCHAT_CONSTANTS.REGION)
.build();
CometChat.init(COMETCHAT_CONSTANTS.APP_ID, appSetting).then(
() => {
console.log("CometChat initialized successfully");
platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch((err) => console.error(err));
},
(error) => {
console.log("CometChat initialization failed with error:", error);
// Check the reason for error and take appropriate action.
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment