Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PFQuery *pushQuery = [PFInstallation query];
- [pushQuery whereKey:@"installationUser" containedIn:recipients];
- // Send push notification to our query
- PFPush *push = [[PFPush alloc] init];
- [push setQuery:pushQuery];
- NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
- message, @"alert",
- @"Increment", @"badge",
- nil];
- [push setData:data];
- [push setMessage:[NSString stringWithFormat:@"%@ sent you a photo!", currentUser.username]];
- [push sendPushInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
- if(!error)
- {
- NSLog(@"Push notification sent!");
- }
- }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement