Skip to content

Commit

Permalink
Updated countly initialization to stop use of deprecated API
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel committed Aug 6, 2023
1 parent 1fb0d0f commit 9362e53
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.sentry.android.core.SentryAndroid;
import ly.count.android.sdk.Countly;
import ly.count.android.sdk.CountlyConfig;
import ly.count.android.sdk.messaging.CountlyConfigPush;
import ly.count.android.sdk.messaging.CountlyPush;

public class ThirdPartyServices {
Expand Down Expand Up @@ -48,7 +49,9 @@ public static void initCountly(Application app) {

public static void registerPush(Application app){
if (Countly.sharedInstance().isInitialized()) {
CountlyPush.init(app, BuildConfig.DEBUG ? Countly.CountlyMessagingMode.TEST : Countly.CountlyMessagingMode.PRODUCTION);
CountlyConfigPush countlyConfigPush = new CountlyConfigPush(app, BuildConfig.DEBUG ? Countly.CountlyMessagingMode.TEST : Countly.CountlyMessagingMode.PRODUCTION)
.setProvider(Countly.CountlyMessagingProvider.FCM);
CountlyPush.init(countlyConfigPush);
NotificationUtility.setChannel(app, CountlyPush.CHANNEL_ID, app.getString(R.string.Settings_Notifications_Label), true, true, true);
ThirdPartyServices.setToken(app);
}
Expand Down

0 comments on commit 9362e53

Please sign in to comment.