I've registered the Notification Action properly and confirmed with a call to [[UIApplication sharedApplication] currentUserNotificationSettings].
I'm using Parse to assemble and send the push like this:
NSString *pushMessage = [NSString stringWithFormat:@"%@ just directly asked: %@", [[PFUser currentUser] username], [self.question objectForKey:@"text"]];
NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
pushMessage, @"alert",
@"questionNotification", @"category",
nil];
PFPush *push = [[PFPush alloc] init];
[push setQuery:pushQuery];
[push setData:data];
[push sendPushInBackground];
The notification does get delivered to the device but it does not have any of the custom actions available that have been registered for the category.
At this point I feel like Parse cannot properly convey the category in the payload? Has anyone gotten them to work with Parse?
Edit: This is the response I get from currentUserNotificationSettings that make me thing the action has been registered successfully:
<UIUserNotificationSettings: 0x14e3eaa0; types: (UIUserNotificationTypeAlert UIUserNotificationTypeBadge UIUserNotificationTypeSound);categories: {(
<UIUserNotificationCategory: 0x14e54c40; identifier: questionNotification, actions: {
1 = (
"<UIMutableUserNotificationAction: 0x14e4b860; identifier: yupAction, title: YUP activationMode: UIUserNotificationActivationModeBackground, isAuthenticationRequired:NO, isDestructive:NO>"
);}>)};>
Update: More research, in case anyone else is having this problem, when I output the userInfo received from the push notification I get:
{aps = {alert = "m just directly asked: Abaxinj";}; category = "QUESTION_CATEGORY";}
So it appears that Parse is putting the category field outside of the aps container, which is probably the problem.
Opened a bug with Parse, they confirmed they're not equipped to handle this yet. They said to check the Parse.com blog for updates when they add ios8's new functionality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With