facebook.login()

Type Function
Library facebook.*
Return value none
Revision Release 2024.3703
Keywords facebook
See also facebook.logout()
Implementing Facebook

Overview

Prompts the user to login to Facebook. This function can be called even if the user is already logged in. If the user is already logged in but new permissions are requested, the user will be prompted to grant the new permissions. The recommended flow is to request no permissions the first time and then ask for additional permissions as they are needed.

Gotchas

Please see the Implementing Facebook guide for important iOS and Android-specific notes.

Syntax

facebook.login( appId, listener [, permissions ] )
appId (required)

String. The Facebook App ID that you receive when you register your app.

listener (required)

Listener. A listener that responds to Facebook events. If listener is a table, it should have a property "fbconnect" that is a function.

permissions (optional)

Array. An optional array of strings that correspond to Facebook's publishing permissions. This enables your application to ask the user to grant certain extended permissions to your app. If not supplied, no extended permissions are requested. Use "publish_actions" to allow posting to the user's wall.

Example

Please see the Implementing Facebook guide for code examples and usage details.