1. Update firebase dependency to latest version [20.2.x]:

implementation 'com.google.firebase:firebase-messaging:20.2.4'

2. Update Pushbots SDK dependency to 3.3.4:

implementation 'com.pushbots:pushbots-lib:3.3.4@aar'

3. Replace initialisation method Pushbots.sharedInstance().init(context) with the updated one:

You will need to provide Web API Key and App Id from Firebase application settings while initializing Pushbots, you can get these credentials through this instructions: https://www.pushbots.help/en/articles/498201-the-google-part-firebase-credentials

Java

new Pushbots.Builder(this)
.setFcmAppId("FCM_APPID")
.setLogLevel(Pushbots.LOG_LEVEL.DEBUG)
.setWebApiKey("WEB_API_KEY")
.setPushbotsAppId("PUSHBOTS_APP_ID")
.setProjectId("PROJECT_ID")
.setSenderId("SENDER_ID")
.build();

Kotlin

Pushbots.Builder(this)
.setFcmAppId("FCM_APPID")
.setLogLevel(Pushbots.LOG_LEVEL.DEBUG)
.setWebApiKey("WEB_API_KEY")
.setPushbotsAppId("PUSHBOTS_APP_ID")
.setProjectId("PROJECT_ID")
.setSenderId("SENDER_ID")
.build()

4. Remove instances of this method from your code, as it'll be automatically handled in new version:

1. registerForRemoteNotifications()

2. setCustomHandler(NotificationReceiver.class)

3. PushNotificationOpened()


Did this answer your question?