Push Notification Configuration
Push Notification Configuration for FCM
If you want push notifications enabled in the VenueSDK please contact us so we can coordinate certificates.
Add the following code to your FCM Message implementation:
override fun onMessageReceived(remoteMessage: RemoteMessage?) {
super.onMessageReceived(remoteMessage)
VenueNext.handleRemoteMessage(this, remoteMessage)
}
Add the following code to register the device with VenueNext:
FirebaseInstanceId.getInstance().instanceId
.addOnCompleteListener(OnCompleteListener { task ->
if (!task.isSuccessful) {
return@OnCompleteListener
}
// Get new Instance ID token
val token = task.result?.token ?: throw IllegalStateException("Token not found")
// Register device
VenueNext.registerDevice(context, token!!)
}