facebook_init

This code initialises Facebook.

Syntax:

GML Code Example

facebook_init(appKey)


Returns: N/A


Description

Before using any of the Facebook functions you must call this function to initialize the Facebook API and tell GameMaker: Studio that you are going to be using the Facebook specific functions. This should be done only once in the game and can be done at any time, but it is recommended that you call this function right at the start before anything else. Note too, that even if you use facebook_logout at some point in your game you will not need to use this function again to log in.


Example:

GML Code Example

facebook_init();
 var permissions = ds_list_create();
 ds_list_add(permissions,"public_profile", "user_friends");
 facebook_login(permissions);
 ds_list_destroy(permissions);
 

The above code initialises Facebook, then creates a ds_list to hold the specific permissions that you wish to request, and finally logs in using these permissions.


Back: Facebook



No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here