Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to send push notification to a specific device without creating channels using parse.com?
    primarykey
    data
    text
    <p>In my ios app, i am using <strong>Parse.com</strong> api there are two view controllers, view controller 1 presents my friends fb profile photos. View controller 2 presents the Friends profile. now i want to send push notification to my selected friend whose FB id i have. can i target a friend with fb id without creating channel? </p> <p>i am trying following code,</p> <pre><code>//View Controller 1 //Register current user after login -(void)registerUserForPushNotification { PFUser *user = [PFUser currentUser]; PFInstallation *currentInstallation = [PFInstallation currentInstallation]; [currentInstallation setObject:user forKey:@"Owner"]; [[PFUser currentUser] setObject:CurrentUserFacebookId forKey:@"fbId"]; [currentInstallation saveInBackground]; } //View controller 2 //Send Push notification to friend -(void)sendPushNotification { // get the PFUser object for current user PFQuery *userQuery=[PFUser query]; [userQuery whereKey:@"fbId" equalTo:ClientFBId];//ClientFBId is my friend's FB id // send push notification to the user PFQuery *pushQuery = [PFInstallation query]; [pushQuery whereKey:@"Owner" matchesQuery:userQuery]; PFPush *push = [PFPush new]; [push setQuery: pushQuery]; NSString *message=[[CurrentUserName stringByAppendingString:@" "]stringByAppendingString:@"sent you ilu"]; [push setData: @{ @"alert":message}]; [push sendPush: nil]; } </code></pre> <p>i have searched the docs. everything is fine. it even shows my push notification on parse.com. but it says "You sent this push notification to 0 recipients." on top of the push notification tab on parse.com.</p> <p>any guesses whats wrong? </p> <p>please note:- i am not sending push notification to all the friends but only one friend at a time. so i guess, i dont have to create a channel.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload