How to send add friend request (to facebook user) from iOS application?

后端 未结 1 1824
无人及你
无人及你 2020-12-03 09:04

I know there are lot of questions on this topic but none of those have satisfactory answers. Again I am not so confident about help as 2 of my last 3 questions are unanswere

相关标签:
1条回答
  • 2020-12-03 09:37

    For user-to-user requests, you can do this (using ARC):

     NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys: message, @"message", title, @"title", nil];
    [[self facebook] dialog: @"apprequests"
                              andParams: [params mutableCopy]
                            andDelegate: delegate];
    

    For app-to-user requests, you can do this:

    NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys: message, @"message", nil];
    [[self facebook] requestWithGraphPath: @"[FRIEND ID]/apprequests"
                                andParams: [params mutableCopy]
                            andHttpMethod: @"POST"
                              andDelegate: delegate];
    

    Make sure you have the right access tokens and the correct Facebook configuration (canvas page setup etc.) for each.

    0 讨论(0)
提交回复
热议问题