API Docs for:

Class Parse.FacebookUtils

Provides a set of utilities for using Parse with Facebook.

init( options )

Initializes Parse Facebook integration. Call this function after you have loaded the Facebook Javascript SDK with the same parameters as you would pass to FB.init(). Parse.FacebookUtils will invoke FB.init() for you with these arguments.

Parameters:
  • options <Object>

    Facebook options argument as described here: FB.init(). The status flag will be coerced to 'false' because it interferes with Parse Facebook integration. Call FB.getLoginStatus() explicitly if this behavior is required by your application.

Boolean isLinked( user )

Gets whether the user has their account linked to Facebook.

Parameters:
  • user <Parse.User>

    User to check for a facebook link. The user must be logged in on this device.


Returns: <Boolean>

true if the user has their account linked to Facebook.

link( user, permissions, options )

Links Facebook to an existing PFUser. This method delegates to the Facebook SDK to authenticate the user, and then automatically links the account to the Parse.User.

Parameters:
  • user <Parse.User>

    User to link to Facebook. This must be the current user.

  • permissions <String, Object>

    The permissions required for Facebook log in. This is a comma-separated string of permissions. Alternatively, supply a Facebook authData object as described in our REST API docs if you want to handle getting facebook auth tokens yourself.

  • options <Object>

    Standard options object with success and error callbacks.

logIn( permissions, options )

Logs in a user using Facebook. This method delegates to the Facebook SDK to authenticate the user, and then automatically logs in (or creates, in the case where it is a new user) a Parse.User.

Parameters:
  • permissions <String, Object>

    The permissions required for Facebook log in. This is a comma-separated string of permissions. Alternatively, supply a Facebook authData object as described in our REST API docs if you want to handle getting facebook auth tokens yourself.

  • options <Object>

    Standard options object with success and error callbacks.

unlink( user, options )

Unlinks the Parse.User from a Facebook account.

Parameters:
  • user <Parse.User>

    User to unlink from Facebook. This must be the current user.

  • options <Object>

    Standard options object with success and error callbacks.