Skip to main content
Version: v6

Push Notifications

Artifacts related with Push Notifications have been extracted from the main repository. You can find them on this GitHub repository

Updated methods

We have changed/removed some methods related with our Push Notification implementation, if you are using any of them, follow the next steps:

  • ChatClient.setDevice(): This method is not needed at all, our SDK already take care of this logic whenever you configure Push Notifications into our ChatClient.
  • ChatClient.dismissChannelNotifications(): This static method has been moved into ChatClient class, so if you were using it, you will need to obtain your ChatClient instance before to call it.
  • NotificationHandlerFactory.createNotificationHandler(): The signature of this factory method has been updated. The lambda that is executed to create the intent that will handle the Push Notification is receiving now the whole Message/Channel entity.
val notificationHandler = NotificationHandlerFactory.createNotificationHandler(
context = context,
newMessageIntent = {
message: Message,
channel: Channel,
->
// Return the intent you want to be triggered when the notification is clicked
val intent: Intent = [....]
intent
}
)

Firebase

If you were using our Firebase Implementation and want to keep it, you only need to switch the dependency in your build.gradle file, and update the imports where the old classes are used.

dependencies {
implementation "io.getstream:stream-android-push-firebase:$stream_android_push_version"
}

The constructor of FirebasePushDeviceGenerator has been updated, now it requires a provider name.

val firebasePushDeviceGenerator = FirebasePushDeviceGenerator(
providerName = "your_provider_name"
)

Huawei

If you were using our Huawei Implementation and want to keep it, you only need to switch the dependency in your build.gradle file, and update the imports where the old classes are used.

dependencies {
implementation "io.getstream:stream-android-push-huawei:$stream_android_push_version"
}

The constructor of HuaweiPushDeviceGenerator has been updated, now it requires a provider name.

val huaweiPushDeviceGenerator = HuaweiPushDeviceGenerator(
context = context,
appId = ApplicationConfigurator.HUAWEI_APP_ID,
providerName = "your_provider_name",
)

Xiaomi

If you were using our Xiaomi Implementation and want to keep it, you only need to switch the dependency in your build.gradle file, and update the imports where the old classes are used.

dependencies {
implementation "io.getstream:stream-android-push-xiaomi:$stream_android_push_version"
}

The constructor of XiaomiPushDeviceGenerator has been updated, now it requires a provider name.

val xiaomiPushDeviceGenerator = XiaomiPushDeviceGenerator(
context = context,
appId = ApplicationConfigurator.XIAOMI_APP_ID,
appKey = ApplicationConfigurator.XIAOMI_APP_KEY,
providerName = "your_provider_name",
)

Did you find this page helpful?