Last active
January 31, 2021 17:17
-
-
Save wajahatkarim3/d42366e762cf582b010d02bde311e5e1 to your computer and use it in GitHub Desktop.
The ZocDoc App class
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
class ZocdocApp : Application() { | |
override fun onCreate() { | |
super.onCreate() | |
initEmoji() | |
initCometChat() | |
} | |
fun initCometChat() { | |
val appID = getString(R.string.app_id) // Replace with your App ID | |
val region = getString(R.string.region) // Replace with your App Region ("eu" or "us") | |
val appSettings: AppSettings = AppSettings.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion( | |
region | |
).build() | |
CometChat.init(this, appID, appSettings, object : CometChat.CallbackListener<String?>() { | |
override fun onSuccess(successMessage: String?) { | |
Log.d("ZocdocApp", "Initialization completed successfully") | |
} | |
override fun onError(e: CometChatException) { | |
Log.d("ZocdocApp", "Initialization failed with exception: " + e.localizedMessage) | |
} | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment