0

In documentation for method

application:didReceiveRemoteNotification:fetchCompletionHandler:

said

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.

I set 'background fetch' and 'Remote notifications' option in .plist and 'launch due to background fetch event' option in scheme settings. If my app running foreground and received push, this method called and all seems ok. But when i run my app from xCode and then move it to background mode (by pressing home button), it won't react on breakpoints or NSLogs in method above when push sent. System displays push notification, but i still can't do some actions when push arrives.

Is it possible to handle push notifications when app is running background?

surfrider
  • 1,376
  • 14
  • 29
  • `background fetch` and `launch due to background fetch event` is for background fetch, not for push notifications. – Cy-4AH Sep 30 '14 at 10:24
  • Yes, i just going over the various options. – surfrider Sep 30 '14 at 10:28
  • There is option `Remote notifications` in `background modes` section. Btw it's mentioned in your's text. – Cy-4AH Sep 30 '14 at 10:31
  • I forgot to say i have already turned this option on. – surfrider Sep 30 '14 at 10:41
  • 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. Also Apps that use significant amounts of power when processing push notifications may not always be woken up early to process future notifications. – christijk Oct 01 '14 at 06:04
  • Yes i know it... But i didn't force-quit it when i tested on simulator. – surfrider Oct 01 '14 at 08:51

0 Answers0