Hi everybody, i found the way to log in with Facebook i hope to enjoy!
To use this component you have to create an app in https://developers.facebook.com/apps/ after you created an app, facebook will give an ID and Client token. You can get this information from your dashboard.
Then Go to Facebook Login > settings and enable Login for devices. finally save changes
This component let you authenticate users in your app using "facebook login", the user should insert a code to authorizate your app to get data as name, profile picture and email. after code is generate the user have to be redirect to facebook.com/device. The developer decide the way to do it. e.g. using a web viewer or activity starter runnig a web browser. after user authorizate your app, an email, name a picture path will be returned.
AppID: (designer only)
The App ID from facebook dashboard.
ClientToken: (designer only)
The client token from facebook dashboard. Go to Settings >Advanced
Generate a code for Sign in with facebook, developers should to redirect the user to http://facebook.com/device to insert the code generated, the code is automatically copy to clipboard for improve the usability. This extension use the basic scope: public_profile and email because not require extra permissions from facebook.
Checks for Authorization status. After generate the user code a ChooseDialogMessage shows in the screen, when user choose "Go to Facebook" AfterMessage event pass facebookUrl for Login and code for check authorization status.
If you use another screen to redirect user to the facebookUrl, you need this block to check authorization status every 5 seconds. After user authorizate your app. AuthorizationChecked event fires with an access token. If user don't authorizate you app. AuthorizationPending event fires with a message.
NOTE: "code" parameter is generated AfterMessage event and it's no same code to given to the user to authorizate the app.
choice: the user selection "Cancel" or "Go to Facebook".
This event fires after the user has made a selection in the message shown. returns "facebookUrl" and "code".
facebookUrl: is the Url to redirect the user to authorize your app login with Facebook.
code: is the code to check authorization status in another screen.
This event fires after the user has authorized your app. returns "accessToken" and "expireIn".
accessToken: is used to Confirm Login and can be used to make a Firebase Authentication credentials too.(coming soon on FirebaseAuth extension).
expireIn: time which access token expire. The user have to make the process again to get a new token.
this event fires when user has not authorized the application yet. Returns a message.
This messages could be:
"This request requires the user to take a pending action"
"User request limit reached"
After confirm login an name, email and picture path is returned. Use this datas to show a confirmation message to the user.
Best practices: remender follow the facebook branding guidelines:
See full documentation process:
FacebookLogin (English message version)
com.mirxtremapps.FacebookLogin.aix (43.6 KB)
FacebookLogin (Spanish message version)
com.mirxtremapps.FacebookLogin.aix (43.7 KB)
aia project (insert your own AppID and ClientToken)
FacebookLogin.aia (77.6 KB)
Facebook Login apk
FacebookLogin.apk (2.2 MB)
Finally you can donate, thank you very much!