Facebook安装的参数不返回数据 [英] Facebook installed parameter not returning data

查看:133
本文介绍了Facebook安装的参数不返回数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试确定我的Facebook朋友之间正在使用我的应用程序。据我所知,一般的智慧是使用图形API,并在获取你的朋友列表时发送'installed'参数。这似乎不适合我,我想知道我在哪里错了。这是我的代码:

I am attempting to determine who among my facebook friends are currently using my app. The general wisdom, as far as I can tell, is to use the graph api, and send the 'installed' parameter when getting your friends list. This does not seem to be working for me, and I am wondering where I am going wrong. This is my code:

首先,有效的权限:

_facebookPermissions = @[@"publish_stream", @"read_stream", @"friends_photos", @"user_photos"];

现在,SLRequest及其设置:

Now the SLRequest and it's setup:

NSString *username = [[NSUserDefaults standardUserDefaults] objectForKey:@"fbUserID"];
    NSString *urlString = [NSString stringWithFormat:@"https://graph.facebook.com/%@/friends", username];

    NSURL *friendsList = [NSURL URLWithString:urlString];
    NSDictionary *friendsListParameters = @{@"fields": @"id,name,picture,installed"};

    SLRequest *getFriends = [SLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:friendsList parameters:friendsListParameters];

现在一个示例结果:

{
            id = 10000123456911;
            name = "Don Dobrian";
            picture =             {
                data =                 {
                    "is_silhouette" = 0;
                    url = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash3/41664_100001237218111_2269_q.jpg";
                };
            };
        },

正如你所看到的,权限将让我几乎一切。但是,没有任何迹象表明已安装参数甚至被注意到。所以这里是我的问题,任何一个的答案可以解决我的问题:

As you can see, the permissions will get me almost everything. But there is no indication at all that the 'installed' parameter was even noticed. So here are my questions, the answer to any one of which would solve my problem:


  1. 这是如何做吗您有什么权限获得已安装的状态?

  2. 有没有更好的方法来获取这个信息使用iOS社会框架?

  1. Is this how you do it? What permissions are you using to get the 'installed' status?
  2. Is there a better way to get this information using the iOS Social Framework?


推荐答案

发生这种情况,明李在评估中死了。仅当朋友安装了应用程序时才返回该参数。每个的一个例子:

As it happens, Ming Li was dead on with his assessment. The parameter is returned only if the friend has the app installed. An example of each:

},
                {
            id = 12645478730;
            installed = 1;
            name = "Edwin Robertson";
            picture =             {
                data =                 {
                    "is_silhouette" = 0;
                    url = "https://fbcdn-profile-a.akamaihd.net/...";
                };
            };
        },
                {
            id = 12645478730;
            name = "Greg Walker";
            picture =             {
                data =                 {
                    "is_silhouette" = 0;
                    url = "https://fbcdn-profile-a.akamaihd.net...";
                };
            };
        },

奇怪的是,我确定这没有按预期工作几个月前,当我最后一次工作的时候。也许FB默认地修复了某些东西,也许我的测试用户正在遇到一些问题,也许我也是被通缉,看到我面前的修复。谁知道。但是,如果您按照上述方法,您应该获得此结果。祝你好运!

What is odd is that I was certain this did not work as expected a couple months ago when I last worked on it. Perhaps FB silently fixed something, perhaps my test user was having some issues, maybe I was just too tunnel visioned to see the fix in front of me. Who knows. But if you follow my method above, you should get this result. Good luck!

这篇关于Facebook安装的参数不返回数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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