facebook - Graph API - Ask user for login if logged out before publishing -


i have website, have custom button visitors can click button , facebook graph api used publish image message user's facebook page.

however, if user not logged in, graph api throws authentication error. how can have facebook's typical popup window open on page asks user login facebook? needs ask permissions well, right?

i understand how use fb.login() method, i'm not sure if used if want add facebook login button page (which not want do).

fb.getloginstatus should give values need in order determine whether user logged in , authorized, unauthorized, or not logged in. values (retrieved the javascript sdk docs) follows:

  1. the user logged facebook , has authenticated application (connected)
  2. the user logged facebook has not authenticated application (not_authorized)
  3. the user not logged facebook @ time , don't know if they've authenticated application or not (unknown)

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

image - ClassNotFoundException when add a prebuilt apk into system.img in android -