如何从iOS应用发送添加好友请求(给Facebook用户)? [英] How to send add friend request (to facebook user) from iOS application?
问题描述
由于我已经google了很多,经历了许多链接,包括
- 如何通过iPhone应用程序向Facebook发送朋友请求?
- 可以从我自己的应用程序发送Facebook的朋友请求吗?
- https://developers.facebook.com/docs/reference/dialogs/requests/
etc ..
最后我发现了:
此对话框做同样的我想要的。那么在图中有什么等同的。或者在iOS sdk中的某些东西, FBDialogueDelegate
。任何可以帮助我的事情。
对于 user-to-user 请求,你可以这样做(使用ARC):
NSDictionary * params = [NSDictionary dictionaryWithObjectsAndKeys:message,@message,title,@title,nil];
[[self facebook] dialog:@apprequests
andParams:[params mutableCopy]
andDelegate:delegate];
对于 app-to-user 请求,您可以这样做:
NSDictionary * params = [NSDictionary dictionaryWithObjectsAndKeys:message,@message,nil];
[[self facebook] requestWithGraphPath:@[FRIEND ID] / apprequests
andParams:[params mutableCopy]
andHttpMethod:@POST
andDelegate:delegate];
确保您拥有正确的访问令牌和正确的Facebook配置(画布页面设置等)每个。
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 unanswered. Well Still, ma question is, Is there any way we can send friend request to any facebook user from one iOS application? Of course we have user id of that user.
As I have googled much and went through many links including
- how send friend request to a person in Facebook through iPhone app?
- Can a facebook friend request be sent from my own app?
- https://developers.facebook.com/docs/reference/dialogs/requests/
etc..
And finally I found it:
This dialog do the same what I want. So is there any equivalent for this in graph. Or something in iOS sdk, FBDialogueDelegate
. Any thing that can help me out.
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.
这篇关于如何从iOS应用发送添加好友请求(给Facebook用户)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!