Start a new topic

Method didReceivedNotification... is not invoked when app in background

ios 10.1

kinvey sdk 1.41.1


When I receive push notification method didReceivedNotification is not called when app in background mode


Hi Wood


Did you include the "content-available" property in your Apple push notification payload?  When using didReceiveRemoteNotification, Apple requires this as per their documentation: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html


Hope this helps

Graeme

I tested my app on ios 9 and ios 10 where "content-available" property is euqal 0 . On ios 9 it works fine unlike ios 10.  If I set value 1 for property "content-available" the  method  didReceiveRemoteNotification is invoked. However  remote notification act as a silent notification, no alert, sound, or badge payload .


Wood,


Please take a look at this link that describes the payload for a push notification: http://devcenter.kinvey.com/ios/reference/business-logic/reference.html#Payloads



Thanks,

Pranav

Kinvey Support

I saw this doc.

This is my push example


 var iOSExtras = {requestType: "requestToExchange"};

    var iOSAps = { 'content-available':0,alert: requestSentByUser.first_name + " wants to exchange your book: "+ requestedBook.title, sound: "notification.wav" };

        push.sendPayload(entityRequestedBookReceiver, iOSAps,iOSExtras);

                response.continue();


ios9 : works

ios 10: doesn't work

None of these solutions work for me(

Wood,

So removing the app completely and then reinstalling it as well as rebooting the phone does not make any difference in your case in terms of the ’sound’ -  just want to confirm this?

Thanks,
Pranav
Kinvey Support

 

Hi


Yes it doesn't make difference. Maybe you have up to date sample for push which I can test for iOS 10 ?

Best Regards 

Alex

I do have the same problem. its working perfectly fine on iOS 9 but it does not on iOS 10. I included the new methods responsible for handling push in iOS 10. i.e. I implemented the UNUserNotificationCenterDelegate protocol. I tried to ask for help from apple developer support and I was told that the problem was coming from the third party SDK i was using for the push. I need help. 


Thanks,

Fabrice.

Login or Signup to post a comment