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
Multiple Uilabels Inside a Self Sizing Uitableviewcell
Swift with iOS 5 Deployment Target
iPhone App Under Test Crashes After a Few Days
JSON Parsing Swift, Array Has No Value Outside Nsurlsession
Get an Array of Property Values from an Object Array
iOS 8 Auto Cell Height - Can't Scroll to Last Row
How to Access Coredata Model in Today Extension (Ios)
Uitableview with Multiple Sections Using Realm and Swift
How to Open Mail App from Swift
Implement Pushkit and Test in Development Behavior
Filemanager Cannot Find Audio File
Can't Assign Multiple Buttons to Uinavigationitem When Using Storyboard with iOS 5
Uitextfield Securetextentry Bullets with a Custom Font
Custom Rounding Corners on Uiview
Animate Uilabel Text Between Two Numbers
iPhone - Draw Transparent Rectangle on Uiview to Reveal View Beneath