iOS Push Notification Background Handler

I’ve got push notifications working from the console. I added “content-available” = 1 to the headers in order to allow app to receive and process the notification in background mode in application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler.

The object returned when the app is active is:
userInfo: {

"BL_PUBLISHER_ID" = "";

DSSubtopic = "";

aps =     {

    alert = "You just got a puch notification!";

    badge = 1;

    sound = "singletone.aiff";

};

"content-available" = 1;

"ios-alert" = "You just got a puch notification!";

"ios-badge" = 1;

"ios-sound" = "singletone.aiff";

}

content-available is not being added to the ‘aps’ object.

The content-available flag allows the app to be activated in background state and perform some task, e.g. update UI while still in background

Do you think you will be able to add this feature that was introduced in iOS 7 soon? Thank you

https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html

Hi Roberto,

Yes, this is already on our roadmap. There is another request for this change in support:
http://support.backendless.com/t/how-to-add-category-to-the-ios-push-notification-payload

Regards,
Mark

Hi, Roberto!

Looks like this is our mistake in docs. Try to send message with header “ios-content-available”.
best regards,
Alex

Thank you Alexandr and Mark. I am trying to test it but I keep getting incorrect header format error from the console. Can you tell me what is wrong with this header statement?

“ios-alert” : “You just got a punch notification!”,“iso-sound” : “singletone.aiff”,“ios-badge” : “1”,”ios-content-available" : “1”

I used the following as a header: ”ios-content-available" : “1” and it worked. The background AppDelegate method also fired so thank you very much Alexandr. Still having issues with the console and correct format. I guess I will have to use the demo app to send out push notifications for now. Not ideal but workable.

Here is a shot of that error

Roberto, it looks like the first double quote character is a “curly” double quote. I think you’re using this one:

but should use this:

"

Please double check.

Thank you so much Mark - my text editor inserted the curly - works like a champ! I’ll be more careful - have a great weekend!!