Facebook iOS SDK - Sending a facebook user an app request

前端 未结 5 1529
野趣味
野趣味 2021-02-10 16:18

Im trying to send an app request through facebook using the facebook iOS SDK, im using the following code:

NSString *message = [[NSString alloc] initWithFormat:@         


        
5条回答
  •  不知归路
    2021-02-10 16:47

    You can easily send the app request very easily by Using Facebook SDK

    For Making App Request Please Make sure Following steps

    1)Make sure you have added the latest Facebook SDK in Your Application Folder

    if not,you may download from this link.

    Now you just need to Add FBConnect Folder in your Project Folder.

    2)Then Make sure you have Registered your iphone App as "App on Facebook" Type Select how your app integrates with Facebook under Basic App Settings.

    if not,you can do that here.

    NSString *friendId=@"FacebookId Of Your Friends";
    
    NSLog(@"%@",friendId);
    
    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"Hi please add me as a friend.",  @"message",
                                       friendId, @"to",
                                       nil];
     [appDelegate.facebook dialog:@"apprequests" andParams:params  andDelegate:self];
    

    Please Don't Forget To Adopt the FBdialogDelegate protocol first in your ViewController Class.

提交回复
热议问题