如何从 iOS 应用程序发送添加好友请求(给 Facebook 用户)? [英] How to send add friend request (to facebook user) from iOS application?

查看:29
本文介绍了如何从 iOS 应用程序发送添加好友请求(给 Facebook 用户)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道关于这个话题有很多问题,但没有一个能得到满意的答案.同样,我对帮助不太有信心,因为我的最后 3 个问题中有 2 个问题没有得到解答.好吧,还有一个问题,有什么办法可以从一个 iOS 应用程序向任何 facebook 用户发送好友请求吗?当然我们有那个用户的用户 ID.

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

  1. 如何将好友请求发送至通过 iPhone 应用访问 Facebook 的人?
  2. 是否可以发送 Facebook 好友请求来自我自己的应用程序?
  3. https://developers.facebook.com/docs/reference/dialogs/请求/
    等等.

我终于找到了:

http://www.facebook.com/dialog/friends?id=100002487216939&app_id=123050457758183&redirect_uri=http://www.example.com/response/

这个对话框和我想要的一样.那么在图中是否有任何等价物.或者 iOS sdk 中的东西,FBDialogueDelegate.任何可以帮助我的事情.

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.

推荐答案

对于 用户-to-user 请求,你可以这样做(使用 ARC):

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];

对于app-to-user 请求,您可以执行以下操作:

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];

确保您拥有正确的访问令牌和正确的 Facebook 配置(画布页面设置等).

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

这篇关于如何从 iOS 应用程序发送添加好友请求(给 Facebook 用户)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆