Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<card>
# FacebookJavaScriptLoginHelper for the Facebook SDK for PHP

A helper class for getting a FacebookSession using the session from the Facebook SDK for JavaScript.
</card>

<card>
## Facebook\FacebookJavaScriptLoginHelper {#overview}

If your web app uses the Facebook SDK for JavaScript, you can access that in your PHP code as well.  This helper class will process and validate the cookie data used by the Facebook SDK for JavaScript, returning a `FacebookSession` on success.

Usage:

~~~~

$helper = new FacebookJavaScriptLoginHelper();
try {
	$session = $helper->getSession();
} catch(FacebookRequestException $ex) {
	// When Facebook returns an error
} catch(\Exception $ex) {
	// When validation fails or other local issues
}
if ($session) {
  // Logged in.
}

~~~~

It's important to note that on first access, or if a session has since expired, these methods will operate on data that is one request-cycle stale.  You will likely want to make an Ajax request when the login state changes in the Facebook SDK for JavaScript.  Information about that here: (FB.event.subscribe)[https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/#events]
</card>

<card>
## Instance Methods {#instance-methods}

### getSession {#getsession}
`getSession()`  
Processes the data available from the Facebook SDK for JavaScript, if present.  Returns a `FacebookSession` or `null`.
</card>

Commits for Nextrek/Android/SmartCharging/endPoints/nightly/fb_SDK/docs/FacebookJavaScriptLoginHelper.fbmd

Diff revisions: vs.
Revision Author Commited Message
461 FSallustio picture FSallustio Mon 03 Aug, 2015 10:04:56 +0000

Aggiunto supporto login Facebook, logout utente e modifiche (solo lato repo) all’utente e al locale.