Didreceiveremotenotification:Fetchcompletionhandler Not Being Called When App Is in Background and Not Connected to Xcode

didReceiveRemoteNotification:fetchCompletionHandler not being called when app is in background and not connected to Xcode

Issue have been fixed in iOS 7.1 Beta 3.
I double checked and I confirm it's working just fine.

IOS doesn't receive first notification in background

If your app wasn’t running, the push notification is passed to your AppDelegate in the launchOptions

    override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
...
let notificationOption = launchOptions?[.remoteNotification]
if let notification = notificationOption as? [String:AnyObject]{
// received notification
}
...
}

didReceiveRemoteNotification fetchCompletionHandler is not getting called in background for silent push

Issue was related to incorrect payload.

I was getting content-available outside aps instead it should be part of aps.

Incorrect payload:

{
"_" = "asd-dfsd-werdsf";
aps = {
};
"content-available" = 1;
}

Correct payload:

    {
"_" = "asd-dfsd-werdsf";
aps = {
"content-available" = 1;
};
}


Related Topics



Leave a reply



Submit