0

How to insert the push notification payload data into database when app is in background. I tried the content-available tag but it doesn't work for me. Please help me out

Pranav
  • 701
  • 4
  • 18
Prashant Sharma
  • 1,357
  • 1
  • 21
  • 31

1 Answers1

1

content-available tag also required and use this method:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {

    //add notification data to your database here

    completionHandler(UIBackgroundFetchResultNewData);
}

And add this to your xcode.

enter image description here

Pranav
  • 701
  • 4
  • 18