Reputation: 621
I'm using silent notifications, which works perfectly when my phone is plugged to Xcode, using Wifi, and with a breakpoint in the application:didReceiveRemoteNotification:fetchCompletionHandler:
method, when my app is in background.
My server is sending a silent notification every minutes. Here is my payload :
{
aps =
{
"content-available" = 1;
};
"update-location" = 1;
}
BUT, when I disable the WIFI from my phone, it doesn't receive it anymore (3g is working as usual).
I got the same behavior when I'm not plugged to Xcode.
Does anyone have a idea, or already solved it?
Upvotes: 1
Views: 481
Reputation:
I'd do the following two things first to help me narrow down the possibilities:
Also, as Viruss mca said, sometimes there's a lag from Apple's servers.
UPDATE: You've also got a semi-colon in there.
aps =
{
"content-available" = 1;
};// << Right there. It should be a comma.
Upvotes: 2
Reputation: 621
Solution : Add the sound key in the silent notification content....
Upvotes: 2
Reputation: 17419
I guess there may two points in your case,
Dont send too many notifications to a device within a short span of time, coz APNS caches only 1 message/device (if the device is offline). So it can deliver the message when the device comes online. Am not sure how long the message is cached though.
APNS is based on Apple Servers, and Apple doesn't give any guarantee on successful message delivery.
it quite clearly in the Apple Docs that it is not 100% gauranteed and nor should it be used as so
Upvotes: 1