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
Asked
Active
Viewed 287 times
0
-
check my answer !! – Pranav Aug 02 '16 at 08:11
-
when app is on foreground control come to this function. But when app is in background control is not coming to function. – Prashant Sharma Aug 02 '16 at 08:16
1 Answers
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.

Pranav
- 701
- 4
- 18