How to invite friends to my application via facebook iOS SDK and Graph API

后端 未结 8 466
攒了一身酷
攒了一身酷 2021-02-01 17:55

I\'m writing an iPhone application.

I want to give the user the option to invite friends to start using my application via Facebook.

More specifically I want to

8条回答
  •  太阳男子
    2021-02-01 18:21

    Today with the 3.11 version of the facebook SDK you should use this in order to send an app request to a specific friend.

    NSString *facebookID = @"YOUR_FRIEND_FACEBOOK_ID"
    NSMutableDictionary* params =
    [NSMutableDictionary dictionaryWithObject:facebookID forKey:@"to"];
    
    NSString *message = @"SOME_MESSAGE";
    NSString *title = @"TITLE";
    
    
    FBSession *facebookSession = [PFFacebookUtils session]; //You may changed this if you are not using parse.com
    
    [FBWebDialogs presentRequestsDialogModallyWithSession:facebookSession
                                                  message:message
                                                    title:title
                                               parameters:params handler:
     ^(FBWebDialogResult result, NSURL *resultURL, NSError *error)
     {
    
     }];
    

提交回复
热议问题