iOS SDK - Push Notification Management Module

DOCS

Last updated: Sept 19th, 8:04pm

Use the endpoints of this module to enable delivery of alert messages - such as available app updates, new offers, upcoming deadlines, new store locations, etc. - from the mobile app to the device, even when the app is not active.

Initialize Push Notification Management Facade

Prior to invoking any push notification management module endpoints:

  1. Create a new request object for the relevant coordinator.
  2. Implement the delegate for the coordinator to handle responses.
    1PDPushNotificationCoordinator *coordinator = [[PDPushNotificationCoordinator alloc] init];
    2 self.PushNotificationCoordinator = coordinator;
    3 [coordinator release];

    isDeviceRegisteredForPushNotifications

    Checks whether the wallet owner has agreed to receive device alerts from the Paydiant platform.

    Element Value
    Method Signature -(void)isDeviceRegisteredForPushNotifications;
    Success void (^isDeviceRegisteredForPushNotificationsCompletionBlock(BOOL isRegistered);

    isRegistered - Indicates whether Paydiant has obtained a device token signaling user consent for push notifications. Valid values are:
    Yes - Paydiant has a valid device token.
    No - Paydiant has no device token. Invoke registration.
    Failure void (^isDeviceRegisteredForPushNotificationsFailureBlock)(PDPaydiantError *pushNotificationManagementError);

    Configure user error messages for this call with the key kUserErrorisDeviceRegisteredForPushNotificationsDomain.

    Error Description
    403 The user must be logged in to make this call.
    500 An unknown error occurred internally in the server.

    registerDeviceForPushNotifications

    Captures and store the device token generated when the user consents to receive push notifications from Paydiant.

    Element Value
    Method Signature -(void)registerDeviceForPushNotifications:(NSString *)deviceToken;

    deviceToken - The value of the iOS-generated token signaling the user's consent to receive push notifications from Paydiant.
    Success void (^RegisterDeviceForPushNotificationsCompletionBlock);
    Failure void (^RegisterDeviceForPushNotificationsFailureBlock)(PDPaydiantError *pushNotificationManagementError);

    Configure user error messages for this call with the key kUserErrorRegisterDeviceForPushNotificationsDomain.

    Error Description
    400 Could not register the device due to invalid arguments in the request.
    403 The user must be logged in to make this call.
    500 An unknown error occurred internally in the server.

    unregisterDeviceForPushNotifications

    Removes the device token that identifies the device as registered to receive push notifications from Paydiant.

    Element Value
    Method Signature -(void)unregisterDeviceForPushNotifications:();
    Success void (^UnregisterDeviceForPushNotificationsCompletionBlock)();
    Failure void (^UnregisterDeviceForPushNotificationsFailureBlock)(PDPaydiantError *pushNotificationManagementError);

    Configure user error messages for this call with the key kUserErrorUnregisterDeviceForPushNotificationsDomain.

    Error Description
    400 Could not unregister the device because it is not registered.
    403 The user must be logged in to make this call.
    500 An unknown error occurred internally in the server.