(void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo ;
and
- (void)application:(UIApplication *)application didReceiveRemoteNotification:
(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult
result))completionHandler{};
never get called ,although i receive the notification on the iphone, Is there any other function that needs to be added for this to work?.Thank you.
Update I tried this when the app is not in background nor active but i didnt receive the message. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Set app's client ID for |GPPSignIn| and |GPPShare|.
[[UIApplication sharedApplication]
registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
// Clear application badge when app launches
application.applicationIconBadgeNumber = 0;
if ([[launchOptions allKeys] containsObject:UIApplicationLaunchOptionsRemoteNotificationKey]) {
id userInfo=[launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"MESSAGE" message:userInfo delegate:self cancelButtonTitle:@"ok" otherButtonTitles: nil];
[alert show];
}