0
votes

I am working on push notification in iOS.

i use parse.com service for push notification.

when i send text notification all thing is good.

but when i terminate app by double tap home button and swipe app, then json notification not receive. (in other word method "application: didReceiveRemoteNotification:" not called).

i use NSLog code to check notification receive and monitoring device consol.

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo{
      NSLog(@"Receive notification in didReceiveRemoteNotification %@", userInfo);
}

i read all similar problem in stackoverflow postes but answer not found.

Edit 1:

I enabled Background mode -> remote notification

1
Did you turn on push notification enabled on your project settings?Ajumal
YES. I enabled Background mode -> remote notificationDr. chamran
Try push notification without using any third party.Ajumal
In other words, I am telling you that the behavior you are seeing is by design. It's not a bug in your code and there's absolutely nothing you can do about it.Avi

1 Answers

0
votes

when your app is in background Remote notification receive, but "application: didReceiveRemoteNotification:" not called Right?

& enable Background Mode

in

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert |
                                                UIUserNotificationTypeBadge |
                                                UIUserNotificationTypeSound);
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes
                                                                         categories:nil];
[application registerUserNotificationSettings:settings];
[application registerForRemoteNotifications];
  // Extract the notification data
NSDictionary *notificationPayload = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey];
}