I have an app that is using push notifications with apples APNS.
Most of the time it works fine, however occasionally (at random it seems, I havent been able to find any verifiable pattern) the messages just dont seem to be getting to the phone.
The messages are being recieved by APNS but just never delivered. However when I reinstall the app or restart the iPhone they seem to arrive.
Im not sure if this is a problem within my app or not, as even when the app is closed (and handling of the notification should rest completely with the Operating System no notification is recieved until a restart/reinstall is done.
The feedback service yields nothing, and NSLogging the received notification within the app also yields nothing (like the notification never makes it to the app)
EDIT:
Some additional information, as nobody seems to know whats going on.
I am using the sandbox server, with the app signed with the developer provisioning profile, so theres no problems there. And the App recieves the notifications initially.
The problem seems to be that when the app doesnt recieve anything when its in the background for about 90s-120s it just stops receiving anything until it is reinstalled.
Even double tapping home and stopping the app that way doesnt allow it to recieve notifications in the app closed state. Which I would have thought would have eliminated problems with the apps coding entirely, since at that point its not even running.
I timed it to see after how long it stops recieving notifications. There are 3 trials here.
==================================Trial 1=====================================
| Notification Number | Time since Last | Total Time | Pass/fail |
| 1 | 6s | 6s | Pass |
| 2 | 30s | 36s | Pass |
| 3 | 60s | 96s | Pass |
| 4 | 120s | 216s | Fail |
==============================================================================
==================================Trial 2=====================================
| Notification Number | Time since Last | Total Time | Pass/fail |
| 1 | 3s | 3s | Pass |
| 2 | 29s | 32s | Pass |
| 3 | 60s | 92s | Pass |
| 4 | 91s | 183s | Fail |
==============================================================================
==================================Trial 3=====================================
| Notification Number | Time since Last | Total Time | Pass/fail |
| 1 | 1s | 1s | Pass |
| 2 | 30s | 61s | Pass |
| 3 | 30s | 91s | Pass |
| 4 | 30s | 121s | Pass |
| 5 | 30s | 151s | Pass |
| 6 | 30s | 181s | Pass |
| 7 | 30s | 211s | Pass |
| 8 | 30s | 241s | Pass |
| 9 | 60s | 301s | Pass |
| 10 | 120s | 421s | Fail |
==============================================================================
Does anyone have any idea what could be going on here.
Another Edit:
Just tested the problem across multiple devices, and its happening on all of them, so its definately not a device issue. The notifications stop coming through even when the app has never been openened. Could the programming within the app effect how the push notifications are received even when its never been open?
It appears this may have been an issue outside of my control, as everything is now working fine, with zero changes.
Going to blame apple or some sort of networking problem somewhere inbetween.