0

I want to retrieve third_party_id of the Facebook's user in my ios application using Facebook SDK. Currently i am trying this

[FBSession openActiveSessionWithPublishPermissions:@[@"basic_info", @"email", @"user_likes",@"user_mobile_phone",@"publish_actions",@"third_party_id"] defaultAudience:FBSessionDefaultAudienceFriends allowLoginUI:YES completionHandler: ^(FBSession *session, FBSessionState state, NSError *error) {
            // Handler for session state changes
            // This method will be called EACH time the session state changes,
            // also for intermediate states and NOT just when the session open
            [self sessionStateChanged:session state:state error:error];
        }];

If i add third_party_id in permissions i am getting following error

**Error Domain=com.facebook.sdk Code=2 "Invalid Scope: third_party_id" UserInfo=0xd26ff50** {
com.facebook.sdk:ErrorSessionKey=<FBSession: 0x11f817f0, state: FBSessionStateClosedLoginFailed, loginHandler: 0x0, appID: 230846087119839, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0xc689090>, expirationDate: (null), refreshDate: (null), attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(null)>, com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:UserLoginOtherError, NSLocalizedDescription=Invalid Scope: third_party_id, com.facebook.sdk:ErrorLoginFailedOriginalErrorCode=100
}

How can i overcome this ? If i retrieve the user profile normally i am not getting third_party_id I am getting this parameter

{
    email = "xxx@xxx.com";
    "first_name" = xxxx;
    gender = male;
    id = xxxxx;
    "last_name" = Mehta;
    link = "https://www.facebook.com/xxxxxxxx";
    locale = "en_US";
    name = "xxxxxxx";
    timezone = "5.5";
    "updated_time" = "2014-04-01T08:52:10+0000";
    username = "xxxxxxxxx";
    verified = 1;
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Mihir Mehta
  • 13,743
  • 3
  • 64
  • 88

1 Answers1

0

For your comment : how can i retrieve third_party_id in my "me" request

Try this :

[FBRequestConnection startWithGraphPath:@"me?fields=third_party_id" completionHandler:^(FBRequestConnection *connection, id result, NSError *error)
    {
        if (!error)
        {
            NSLog(@"user events: %@", result);
        }
        else
        {

        }            
    }];

Log :

user events: { id = 1234567; "third_party_id" = "xedted10XKVl1DtF9WHOFa_LoR8"; }

Maulik
  • 19,348
  • 14
  • 82
  • 137