Muhammad Hassan
Muhammad Hassan

Reputation: 111

Get access token from Phonegap FaceBook plugin

I am using the Corodova FaceBook plugin for iOS from GitHub. I have already spent many hours searching, but I have found nothing. How can I get and save the access token of the user? Later on I want to use this access token for data publishing.

Upvotes: 0

Views: 656

Answers (1)

Liran Brimer
Liran Brimer

Reputation: 3556

FB.getLoginStatus(handleStatusChange);

function handleStatusChange(session) {
  if (session.authResponse) 
      alert(session.authResponse.accessToken); // This will print the token
}

Upvotes: 1

Related Questions