You can use receivedNotification and openedNotification callback blocks to handle incoming notifications in iOS:

Objective-c

 [Pushbots initWithAppId:@"APP_ID" withLaunchOptions:launchOptions prompt:true receivedNotification:^(NSDictionary *result) {
 NSLog(@"receivedNotification: %@", result);
} openedNotification:^(NSDictionary *result) {
  NSLog(@"openedNotification: %@", result);
}];


swift:

Pushbots.initWithAppId("PUSHBOTS_APPID", withLaunchOptions: launchOptions, prompt: true, receivedNotification:{(result) in
    print(result)
}, openedNotification:{(result) in
    print(result)
})




receivedNotification callback will be executed when the user receives a notification while the application is open/in foreground.

openedNotification callback will be executed when the user receives a notification while the application is open/in foreground and after clicking on a notification while app in background or killed.

Did this answer your question?