objective c - FCM Notification Method is not called in background mode -
i have made 1 sample demo push notification fcm. able received notification in ground mode foreground mode. question is:- when application in background mode notification received not called single method can action.
i agreed when have clicked on method call 1 method not in background.
method have used
- (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo fetchcompletionhandler:(void (^)(uibackgroundfetchresult))completionhandler { } - (void)usernotificationcenter:(unusernotificationcenter *)center willpresentnotification:(unnotification *)notification withcompletionhandler:(void (^)(unnotificationpresentationoptions options))completionhandler { }
please me guys got stuck.i need in advance. have read many links not able solved problem.
note:- please keep in mind have used google clouding messaging:- fcm
i have used in objective c
as per our discussion in comments under question. here few more things done achieve requirement. m posting these points not familiar content-available
thing.
open xcode project and
1: in project navigator, select project.
2: in editor, select ios app target.
3: select capabilities tab.
4: enable push notification under capabilities.
5: enable background modes capability.
6: enable remote notifications background mode.
now if notification payload contains content-available : 1
app awakened in background.
the system delivers notifications calling application:didreceiveremotenotification:fetchcompletionhandler:
method of app delegate. use method initiate desired operations.
wiki
Comments
Post a Comment