• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - 使用我的 FacebookAppID 在 iOS 中不起作用

[复制链接]
菜鸟教程小白 发表于 2022-12-12 23:50:18 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

我想使用 Facebook Api 来获取 Facebook 好友列表。因此,我在 Facebook 上创建了新应用程序当我在我的原生 iOS 应用程序中使用该 AppID 和 Bundle ID 并使用 api 获取所有 friend 列表时获得 AppID 并提供 Bundle ID 并获得空 friend 列表。

如果我使用 "SendRequestHowTo" 的 App ID示例项目它获取登录用户的所有好友列表。告诉我如何在 Facebook 开发者网站上配置我的新应用程序以获取好友列表。

我的获取好友列表的代码:

// Query to fetch the active user's friends, limit to 25.
    NSString *query =
    @"SELECT uid, name, pic_square FROM user WHERE uid IN "
    @"(SELECT uid2 FROM friend WHERE uid1 = me())";
    // Set up the query parameter
    NSDictionary *queryParam = @{ @"q": query };
    // Make the API request that uses FQL
    [FBRequestConnection startWithGraphPath"/fql"
                                 parameters:queryParam
                                 HTTPMethod"GET"
                          completionHandler:^(FBRequestConnection *connection,
                                              id result,
                                              NSError *error) {
                              if (error) {
                                  NSLog(@"Error: %@", [error localizedDescription]);
                              } else {
                                  _friends_list = (NSArray *) result[@"data"];
                                  NSLog(@"Result: %@", result);

                                  [self getLetsWalkeeFriendList];

                                  // Sort Table Data
                                  [self sortTableView];
//                                  [_tbl_view_friends reloadData];
                              }
                              [self.view setUserInteractionEnabled:YES];
//                              [self.view hideToastActivity];
                          }]; 

使用示例项目 AppID(即 FacebookAppID:403223126407920 和捆绑标识符:com.facebook.samples.SendRequestsHowTo)。当我用 facebook 登录时,我得到了输出

Result: {
    data =     (
                {
            name = "Assad Sarwar";
            "pic_square" = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpa1/t1.0-1/c153.5.545.545/s50x50/1978738_766566543368250_230425531_n.jpg";
            uid = 100000447351759;
        },
                {
            name = "Muhammad Hassan Butt";
            "pic_square" = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xap1/t1.0-1/c0.0.50.50/p50x50/10167970_873047696055100_7845811348955741805_n.jpg";
            uid = 100000496339789;
        },
                {
            name = "Umair Jafar";
            "pic_square" = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xfp1/t1.0-1/c0.2.50.50/p50x50/10500337_910092152350902_4827832642500691993_n.jpg";
            uid = 100000503784242;
        }, .........
)
}

当我使用 facebook 提供的 AppID 并使用同一用户登录 facebook 时,我得到了类似的输出

 Result: {
            data =     ( )
    }



Best Answer-推荐答案


对于 2014 年 4 月 30 日之后创建的应用,端点 /me/friends 将仅返回也使用您的应用的 friend 列表。请参阅平台升级指南 [1]。

[1] https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids

关于ios - 使用我的 FacebookAppID 在 iOS 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24781835/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap