Search in sources :

Example 1 with AppSettings

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);
}
Also used : CometChatException(com.cometchat.pro.exceptions.CometChatException) AppSettings(com.cometchat.pro.core.AppSettings) CometChat(com.cometchat.pro.core.CometChat)

Aggregations

AppSettings (com.cometchat.pro.core.AppSettings)1 CometChat (com.cometchat.pro.core.CometChat)1 CometChatException (com.cometchat.pro.exceptions.CometChatException)1