Show TOC

Enabling Apple Push Notifications (APNS)Locate this document in the navigation structure

(Optional) Enable Apple Push Notifications (APNS) for an iOS application.


  1. Enable the certificate for push. Use the Apple Push Notification service to propagate information from the backend to the device. Use the native iOS push services to enable APNS for iOS applications. For information on enabling certificates for APNS, see the Apple Web site at: published on non-SAP site
  2. Configure APNS Push using the cockpit on the server-side to receive APNS.
  3. Add these two methods into the AppDelegate class to fetch the device token at the client side:
    -(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData
       NSString *devToken=[[[NSString alloc]initWithData:deviceToken encoding:NSUTF8StringEncoding]autorelease];
       NSLog(@"Device Token:  %@",devToken);
    -(void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
       NSLog(@"Error Occurred: %@",[error description]);
  4. After successful registration, use the class SMPAppSettings to set the device token received in didRegisterForRemoteNotificationsWithDeviceToken. The following code illustrates this method:
    NSError* error = nil;
    NSDictionary *props = [NSMutableDictionary dictionary];
    [props setValue:deviceToken forKey:@"d:ApnsDeviceToken"];
    [appSettings setConfigProperty:props error:&error];
       if (error) {
                NSLog(@"ERROR:  %@",error);