Using native Facebook SDK I can try to login FB silently. It’s very useful when the user starts the game the next time he logged in Facebook, so you can avoid to show the login prompt. This is the piece of code that does it:
/**
- Attempts to silently open the Facebook session if we have a valid token loaded (that perhaps needs a behind the scenes refresh).
- After that attempt, we defer to the basic concept of the session being in one of the valid authorized states.
*/
- (BOOL)isSessionValidAfterOpenAttempt {
NSLog(@“FBSession.activeSession: %@”, FBSession.activeSession);
// If we don't have a cached token, a call to open here would cause UX for login to // occur; we don't want that to happen unless the user clicks the login button over in Settings, and so // we check here to make sure we have a token before calling open if (FBSession.activeSession.state == FBSessionStateCreatedTokenLoaded) { NSLog(@"We have a cached token, so we're going to re-establish the login for the user."); // Even though we had a cached token, we need to login to make the session usable: [FBSession.activeSession openWithCompletionHandler:^(FBSession *session, FBSessionState status, NSError *error) { NSLog(@"Finished opening login session, with state: %d", (int)status); }]; } else { NSLog(@"Active session wasn't in state 'FBSessionStateCreatedTokenLoaded'. It has state: %d", (int)FBSession.activeSession.state); }
return [self isSessionValid];}
Is there any way I could achieve this using sdkbox?
Thanks in advance.
Thank you.