Remote push notification doesn't wake up app

We use remote push notification with content available key set to 1 which , from

apple documentation, it has to wake up the app, but it doesn't work properly, sometimes

the app doesn't wake up.

We use this mechanism to send device location to our server.

Why remote push notification doesn't wake up my app all the time ?

We are having similar issues and I posted a slightly different issue a couple days ago to these forums. We noticed that it works when the app is in background but that when the app moves from background to suspended (Apple decides when this happens based on resources, etc.) that is when it stops working. Have you noticed the same type of thing, that it stops working after the app has been in background for an extended period of time?


Also, I notice that this post has been up for 10 days and still does not have any replies. Do questions get answered on these forums? How are we supposed to figure this stuff out if no one wants to help out?

The silent push will not wake up the application if it was killed from the app switcher by the user.

I hope you didn't forget to set the background mode in the info plist.


UIKit Framework Reference:

Use this method to process incoming remote notifications for your app. Unlike the

application:didReceiveRemoteNotification:
method, which is called only when your app is running in the foreground, the system calls this method when your app is running in the foreground or background. In addition, if you enabled the remote notifications background mode, the system launches your app (or wakes it from the suspended state) and puts it in the background state when a push notification arrives. However, the system does not automatically launch your app if the user has force-quit it. In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again.

Pavel V... I understand that it will not work if user force quits the app. That is not what I am referring to. I am referring to the suspended state. Here is a copy of my other post, would really appreciate if you have any information that might help us...


Our Cordova/hybrid iOS app needs to get content updates from Parse and run some background tasks. It is set up so push notifications with "content-available": 1 are sent whenever new data is available. The 'Remote Notifications' and 'Background Fetch' Background Modes are enabled for the info.plist (Xcode) settings. Everything works perfectly when the app is in background or foreground. But, whenever the app transitions to the suspended state incoming push notifications do not move it from suspend and into background state, for a fetch of the new data from Parse.


Can anyone please help give some insight as to how to wake the app from suspend state and into background (note, we verified that the json push data sent to Parse has "content-available": 1) or is this even possible?

I heard that people complain that the silent push does not arrive. For example, for a minimal payload { aps: { content-available: 1} }. People told that when the app is in the foreground this minimal push arrives. But then the app is in the background, there is a problem.

If this is the push you send, can you add a sound? Just for a test purpose. To have something like

{"aps":{"content-available": 1, "sound":""}}

Pavel,


We are using push with sound, always have been. It works perfect when app is in "background" state, just stops working when app enters suspended state. have you had any luck updating an app that is in suspended state? I personally notice even big budget apps like Skype, Evernote, etc seem to do a refresh when they launch to get new data and am beginning to wonder if this is the reason they do such a thing. Would greatly prefer to let push trigger the refresh if possible... Just can't seem to get it to work. Have followed all the docs and triple checked our work, but just doesn't happen when app reaches that suspended state.

Try to add "alert" parameter too.

You didn't forget to call the handler as soon as possible?

You opened correct flag in the nfo.plist? remote-notification?


It's possible to use -setKeepAliveTimeout:handler: in a VoIP app, for example.

Probably, next step is to ask the technical support.

Hi!


were you ever able to resolve this issue?


We are currently encountering a similar issue in which our application is unable to report to our backend after a period of time. We didn't used to experience this, so it is seems that Apple has become more agressive about not allowing background activities..


Any advice you could offer to help us figure our how to keep background connectivity would be greatly appreciated!


Thanks!

"Use this method to process incoming remote notifications for your app."


Which method are you talking about? You seem to be referring to the link you gave above your statement. Your link is to the UIApplicationDelegate protocol. It doesn't explain what method you are talking about.

I'm having the same issue. Have you figured out how to do what you intend to do?

This thread is 4 years old. It’s unlikely you’ll get responses from the original commenters I think.


But nothing has really changed. There is still no general purpose API that will guarantee your app will be woken up for background processing on any set schedule. Silent push notifications are deliberately unreliable. They may be batched / deferred / discarded for power saving reasons at the OS’s discretion.

OK. Thank you.

Remote push notification doesn't wake up app
 
 
Q