如何获取尚未安装该应用程序的Facebook朋友列表? [英] How to get the list of Facebook friends who have not installed the app?

查看:114
本文介绍了如何获取尚未安装该应用程序的Facebook朋友列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个社交网络应用程序.我已经在我的iOS应用程序中集成了Facebook SDK 3.14.现在,我想获取我所有Facebook朋友的列表,这样我就可以邀请那些不使用该应用程序的朋友,并向已经安装该应用程序的朋友发送朋友请求.

I'm developing a social networking app. I've integrated Facebook SDK 3.14 in my iOS App. Now, I want to get the list of all my Facebook friends so I can invite those friends who are not using the app and send friend requests to those friends who have already installed the app.

我可以使用"/me/friends"获取已经使用我的应用程序的朋友列表.

I can get the list of friends who already use my apps using "/me/friends".

[FBRequestConnection startWithGraphPath:@"/me/friends"
                             parameters:nil
                             HTTPMethod:@"GET"
                      completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                          NSLog(@"All == %@", result);
                      }];

它提供了朋友的Facebook ID(例如ID = 654330727444458)作为响应,以便我可以向他们发送朋友请求.

It gives friends' Facebook ids (ex. id = 654330727444458) in response so that I can send friend requests to them.

要获取尚未下载该应用程序的所有Facebook朋友的列表,如果我想邀请这些朋友,我需要使用"me/taggable_friends"来吸引所有朋友(如果我输入错了,请纠正我).

To get the list of all Facebook friends who have not downloaded the app and if I want to invite those, I need to get all friends using "me/taggable_friends" (Please correct me if I'm wrong).

[FBRequestConnection startWithGraphPath:@"/me/taggable_friends"
                             parameters:nil
                             HTTPMethod:@"GET"
                      completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                          NSlog("%@", result);
                      }];

taggable_friends响应中,我得到朋友的ID为id = "AaLYBzZzHdzCmlytqyMAjO0OLDZIOs74Urn93ikeRmmTB3vX_Xl81OYUt4XnoWG0BDLuX67umVkheVdDjzyvm0fcqMqu84GgM9JnNHc-1B63eg,这是朋友的令牌ID,并且不是唯一的.我不能使用它,而必须使用朋友的Facebook ID邀请他们.不幸的是, ,我无法在可标记的朋友回复中得到它.

In the taggable_friends response I'm getting friend's id as id = "AaLYBzZzHdzCmlytqyMAjO0OLDZIOs74Urn93ikeRmmTB3vX_Xl81OYUt4XnoWG0BDLuX67umVkheVdDjzyvm0fcqMqu84GgM9JnNHc-1B63eg" which is friend's token id and it's not unique. I couldn't use it instead, have to use Facebook Id of friend to invite them. Unfortunately, I couldn't get it in the taggable friend response.

推荐答案

仅在Facebook API v1上可行,该API将于明年4月左右停止运行.即使现在,只有现有的Facebook应用程序仍允许您使用V1,因此,如果您没有足够老的应用程序,您将无法执行此操作.在V2中,您只能获得也登录了同一应用程序但用户ID对于该应用程序来说是唯一的朋友,以防止发生这种情况.我猜Facebook之所以这样做,是因为它阻止人们通过应用程序向他们的朋友发送垃圾邮件的原因如此之多:/

This is only possible on the Facebook API v1 which stops working next April or so. Even now only existing Facebook apps will allow you to use V1 so if you don't have an old enough app you are not able to do this. In V2 you can only get friends who have also signed in to the same app but the user id's are unique to the application to prevent exactly this. I guess Facebook reasons that by doing this is stops people spamming their friends via apps so much :/

正如@joelrb所说,您可以为游戏创建画布应用程序并使用invitable_friends,但是FB会审核您的游戏",因此您无法真正作弊.

As @joelrb says you can create a canvas app for a game and use invitable_friends but FB will vet your "game" so you can't really cheat.

有关更多信息,请参见 https://developers.facebook.com/docs/apps/changelog/

See https://developers.facebook.com/docs/apps/changelog/ for more info.

TLDR;贴到墙上就是您所能做的.艰难的.抱歉.

TLDR; post to wall is all you can do. Tough. Sorry.

这篇关于如何获取尚未安装该应用程序的Facebook朋友列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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