For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Scenario 3: Existing applications using broadcast/Unicast notification in their application
Client
- Initialize the MFPPush client instance in your application:
[[MFPPush sharedInstance] initialize];
- Implement the notification processing in the didReceiveRemoteNotification().
- Register the mobile device with the push notification service:
[[MFPPush sharedInstance] registerDevice:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to register"); }else{ NSLog(@"Successfullyregistered"); } }];
- (Optional) Un-register the mobile device from the push notification service.
[MFPPush sharedInstance] unregisterDevice:^(WLResponse *response, NSError *error) { if(error){ NSLog(@"Failed to unregister"); }else{ NSLog(@"Successfully unregistered"); } }];
- Remove WLClient.Push.isPushSupported() (if used) and use:
[[MFPPush sharedInstance] isPushSupported]
- Remove the following WLClient.Push API's:
- registerEventSourceCallback()
- WLOnReadyToSubscribeListener Implementation
Server
Remove WL.Server.sendMessage (if used) in your adapter.
Complete the following steps for every application that was using the same event source:
- Set up the credentials by using the MobileFirst Operations Console. See Configure push notification settings.
We can also set up the credentials by using Update GCM settings (PUT) REST API, for Android applications or Update APNs settings (PUT) REST API, for iOS applications.
- Add the scope push.mobileclient in Scope Elements Mapping.
- Create tags to enable push notifications to be sent to subscribers. See Create tags for push notification.
- We can use either of the following methods to send notifications:
- The MobileFirst Operations Console. See Sending push notifications to subscribers.
- The Push Message (POST) REST API with userId/deviceId.
Parent topic: Native iOS applications