Created
June 13, 2021 09:47
-
-
Save wizlee/9fb5bc670cace9971bbc13b369e7fffd to your computer and use it in GitHub Desktop.
angular-marketplace-totorial-main.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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