use of com.cometchat.pro.core.AppSettings in project android-java-chat-push-notification-app by cometchat-pro.
the class UIKitApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
AppSettings appSettings = new AppSettings.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(AppConfig.AppDetails.REGION).build();
CometChat.init(this, AppConfig.AppDetails.APP_ID, appSettings, new CometChat.CallbackListener<String>() {
@Override
public void onSuccess(String s) {
CometChat.setSource("push-notification", "android", "java");
Log.d(TAG, "onSuccess: " + s);
}
@Override
public void onError(CometChatException e) {
Toast.makeText(UIKitApplication.this, e.getMessage(), Toast.LENGTH_SHORT).show();
}
});
CometChatCallListener.addCallListener(TAG, this);
createNotificationChannel();
ProcessLifecycleOwner.get().getLifecycle().addObserver(this);
}
Aggregations