You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Hide Custom Button If Can't share](#hide-custom-button-1)
47
47
-[Login Response](#login-response)
48
48
-[Get Current Access Token](#get-current-access-token)
49
+
-[Basic Analytics](#basic-analytics)
49
50
-[Graph API Example](#graph-api-example)
50
51
-[Release notes](#release-notes)
51
52
-[FAQ](#faq)
@@ -595,6 +596,34 @@ The callback that have to be provided to Facebook.login method receives 2 argume
595
596
## Get Current Access Token
596
597
The plugin allows to get the current access token, if any, via getCurrentAccessToken() method.
597
598
599
+
## Basic Analytics
600
+
The plugin allows to log analytics events. At the initialization of the application you need to init analytics:
601
+
602
+
```Typescript
603
+
application.on(application.launchEvent, function (args) {
604
+
nsFacebook.init("{facebook_app_id}");
605
+
nsFacebook.initAnalytics();
606
+
});
607
+
```
608
+
609
+
Events logging:
610
+
611
+
```Typescript
612
+
nsFacebook.logEvent('Lead');
613
+
```
614
+
615
+
Logging event with parameters:
616
+
617
+
```Typescript
618
+
const value =5;
619
+
const parameters = [{
620
+
key: 'value',
621
+
value: value.toString(),
622
+
}];
623
+
624
+
nsFacebook.logEvent(FundsAdded, parameters);
625
+
```
626
+
598
627
## Graph API Example
599
628
Once the Facebook access token is retrieved you can execute Graph API requests. In the example below after successful login, the access token is stored in application settings. And then on the home view it is retrieved and 2 Graph API calls are executed.
0 commit comments