Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. PFQuery *pushQuery = [PFInstallation query];
  2. [pushQuery whereKey:@"installationUser" containedIn:recipients];
  3.  
  4. // Send push notification to our query
  5. PFPush *push = [[PFPush alloc] init];
  6. [push setQuery:pushQuery];
  7. NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
  8. message, @"alert",
  9. @"Increment", @"badge",
  10. nil];
  11.  
  12.  
  13. [push setData:data];
  14. [push setMessage:[NSString stringWithFormat:@"%@ sent you a photo!", currentUser.username]];
  15.  
  16.  
  17. [push sendPushInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
  18. if(!error)
  19. {
  20. NSLog(@"Push notification sent!");
  21. }
  22. }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement