ThangBM
ThangBM

Reputation: 301

How to get user name in response of request getting feeds of group in iOS application?

I implemented graph api for getting feeds in group as facebook document :

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

but response doesn't include exactly user id of user who posts that feed. response sample like this :

 {
    "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" field doesn't have username field,I want to get username for messenger deeplink with format : m.me/$USERNAME

So anyone can help me to get username in response of this request?

Upvotes: -1

Views: 233

Answers (1)

ssakash
ssakash

Reputation: 630

Change the url from https://www.facebook.com/profile.php?id=970860453059720

to

https://www.facebook.com/970860453059720

Then you can get the profile page of the user.

Upvotes: 2

Related Questions