iOS remote notification not waking up the code after sometime

262 views Asked by At

I am developing an application where we are continuously pinging the device from Server through remote notifications to check if the user is using the app (In Foreground / In Background / In Suspend) or not.

To do this I am sending remote notifications every 5 mins to the device. This remote notification wakes up my app. The app then calls a method on the sever saying "I am alive".

This is not a chatting application hence no socket. But I need to know if the user is in logged in state or not and hence continuous pings to check the status.

This works fine for me for 30-40 hours on iPAD but it only works 10-12 hours on iPhone.

After 12 hours on iPhone, I traced the logs I figured out that the device DID receive the notification, however it never woke up the code that could tell the server if the user was online.

Is there a limitation on the number of notifications that the device can receive from the server? Am i being too frequent? Also, would I be increasing the heap size or something which might be pushing the OS not to wake up my app?

Let me know if posting code would help. Thanks!

0

There are 0 answers