如何获取用户名以响应在iOS应用程序中获取组的订阅源的请求?

时间:2018-03-03 12:12:46

标签: ios facebook-graph-api graph facebook-feed

我实现了图形api,用于获取组中的提要作为facebook文档:

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
    initWithGraphPath:@"/1600251423601292/feed"
           parameters:nil
           HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
    NSDictionary* resultDict = (NSDictionary*)result;
}];

但响应不包括发布该Feed的用户的用户ID。响应样本如下:

 {
    "created_time" = "2018-03-03T00:20:10+0000";
    from =     {
        id = 970860453059720;
        name = "S\U1eefa Chua M\U00edt";
    };
    id = "1685903041732687_2030105113979143";
    message = "T\n\U20ab40 - H\U00e0 N\U1ed9i\n\nT\U00e2n tri\U1ec1u - \U0111\U01b0\U1eddng m\U1ef9 \U0111\U00ecnh \U1ee9ng 310k ship 40k. 0944193728 h\U00e0ng l\U1ed3ng inox nh\U1ecf bu\U1ed9c sau xe k c\U1ed3ng k\U1ebfnh. \U0110i lu\U00f4n";
    "updated_time" = "2018-03-03T00:20:10+0000";
}

“from”字段没有用户名字段,我想获取messenger deeplink的用户名,格式为:m.me/$USERNAME

所以任何人都可以帮助我获取用户名以回应此请求?

1 个答案:

答案 0 :(得分:2)

https://www.facebook.com/profile.php?id=970860453059720

更改网址

https://www.facebook.com/970860453059720

然后您可以获取用户的个人资料页面。