Setting up Push Notifications
class MyFirebaseMessagingService : FirebaseMessagingService() {
override fun onNewToken(token: String) {
super.onNewToken(token)
// This method is called when a new token is generated.
LucraPushNotificationService.refreshFirebaseToken(token)
}
override fun onMessageReceived(message: RemoteMessage) {
super.onMessageReceived(message)
// Determines if this push notification is Lucra-specific. We will show the resulting notification if it is
if (!LucraPushNotificationService.handlePushNotification(
context = this,
remoteMessage = message,
activityClass = MainActivitySdk::class.java,
smallIcon = R.drawable.lucra_letter_landing
)
) {
showNotification(message)
}
}
private fun showNotification(message: RemoteMessage) {
//Show your app specific notifications
}
}LucraPushNotificationService.refreshFirebaseToken(token)
LucraPushNotificationService.handlePushNotification(...)
Handling Lucra push notification click events
Last updated
