I'm having a really bizarre issue with push notification.
When the app is connected to Xcode (debug build), didReceiveRemoteNotification:fetchCompletionHandler
acts like it's supposed to.
didReceiveRemoteNotification:fetchCompletionHandler
is triggered when push is received when app is in the foregrounddidReceiveRemoteNotification:fetchCompletionHandler
is triggered when push is received when app is in the backgrounddidReceiveRemoteNotification:fetchCompletionHandler
is triggered when push is received and app is opened via notification center (from push)
However, when I build my app on my phone not using xcode:
didReceiveRemoteNotification:fetchCompletionHandler
is
triggered when push is received when app is in the foregrounddidReceiveRemoteNotification:fetchCompletionHandler
is NOT triggered when push is received when app is in the backgrounddidReceiveRemoteNotification:fetchCompletionHandler
is
triggered when push is received and app is opened via notification center (from push)
To complicate things further:
For some ungodly reason, this just stopped working. Then, just randomly, it appears that it fixed itself (this was all in a span of 24 hours). However, about 5 minutes ago, it stopped working again. It also seems that some of my users are experiencing the same thing, while others are just fine.
I though it could be something wrong with the production push certificate, but then why I'm I receiving pushes? I'm totally lost here.
PS: The message payload template:
{
aps = {
alert = "<message>";
badge = 1;
"content-available" = 1;
sound = "layerbell.caf";
};
layer = {
"<convoId>";
"<messageId>";
};
}
Please note that this has nothing to do with a terminated state. I know that didReceiveRemoteNotification:fetchCompletionHandler
will not be called if the app is terminated. This is not what the issue is.
didReceiveRemoteNotification
. I know this. This is not what I am testing. The post refers to the app being in a background state already. – Fortieth