user4841157
user4841157

Reputation:

FBSDKAccessToken currentAccessToken doesn't work

I'm trying to fix new FBSDKAccessToken, but I still don't know how

My code:

if ([FBSDKAccessToken currentAccessToken]) {
    NSLog(@"In");
} else {
    NSLog(@"Out");
}

When I'm successful logged in, NSLog always prints Out. I set delegate, everything from FB's developer etc and still nothing.

Knows somebody why?

Upvotes: 0

Views: 1912

Answers (1)

Kishore
Kishore

Reputation: 184

I resolved it by retrieving the token string. If the token string is nil then i'll allow user to login or else i'll navigate to home page.

Some thing like this.

NSString *tokenValue = [[FBSDKAccessToken currentAccessToken] tokenString];

if ([tokenValue length] == 0)
{

    NSLog(@"Allow user to login");
}

else
{

 NSLog(@"User is Already logged in");

}

Hope this helps.

Thanks.

Upvotes: 1

Related Questions