Notifications

Pre-requisite: The user has to be signed in to perform the following operations.


Register for Push Notifications

To register for push notifications, the following method can be called.

  • request (required): The notification registration request object.
val request = NotificationRegistrationRequest(
  token = "testtoken", // The device token used to send the push notification to the device.
  provider = NotificationProvider.FCM, // The provider used to send the push notification.
  deviceId = "testDeviceId" // The device id of the phone to which the push notification is to be sent. This value should not change until the re-installation of the app.
)
InstaVision.userServices.registerForPushNotifications(
  request = request,
  onSuccess = {
    // Push notification registration successful
  },
  onError = {
    // The error object contains the error code and message
  }
)