Push Notification

Handles Push Notification related requests with IMS web services. Unless otherwise specified, requests performed by this service are on the current Device.

The PushNotification uses the Device API and it is seperated from Device module considering any new features may be implemented in future to expand PushNotificationService.

Required information

*Identity: In order to set push notification token for the device, the application must have a valid user (represented by the Identity). That user must be active.

Parameters:

  • deviceToken: user's deviceToken ID

Concrete example

To set the push notification token to DriveSync, one can use following snippet

let service = PushNotificationService(identity: identity)
service.setToken(deviceToken: deviceToken, then: { result in
    switch result {
    case .success(_):
        // passing token successful
        break
    default:
        // error
    }
})

Last updated