Reputation: 104145
I’m trying to send “background push” (content-available
) notifications to an iOS device. The receiving code works fine, as verified by the Houston command-line utility. I can also send regular push notifications just fine through Parse. But as soon as I add the content-available
key (setting it to @YES
), the push notifications are never delivered. Trying with different alert
and sound
values does not change anything. When I look into the Parse web “console” under the Push Notifications tab, the “Subscribers” value for these undelivered notifications is zero. What am I doing wrong?
Upvotes: 1
Views: 854
Reputation: 7677
Try to set "content-available
" to @"1"
instead of @yes
For example, my working code:
NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
@"", @"alert",
@"1", @"content-available",
nil];
PFPush *push = [[PFPush alloc] init];
[push setQuery:someQuery];
[push setData:data];
[push sendPushInBackground];
Upvotes: 1
Reputation: 394146
Perhaps you are not registering to the correct notification types.
Try :
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationTypeNewsstandContentAvailability];
Upvotes: 0