-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
25 lines (24 loc) · 859 Bytes
/
index.js
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
const platformModule = require("tns-core-modules/platform");
const app = require("tns-core-modules/application");
module.exports = {
initSdk: function (fbAppId) {
try {
if (platformModule.isAndroid) {
if(fbAppId)
com.facebook.FacebookSdk.setApplicationId(fbAppId);
com.facebook.FacebookSdk.setAutoLogAppEventsEnabled(true);
com.facebook.FacebookSdk.sdkInitialize(app.android.context);
//com.facebook.appevents.AppEventsLogger.newLogger(app.android.context).logEvent("Registered");
}
else {
if(fbAppId)
FBSDKSettings.setAppID(fbAppId);
FBSDKSettings.setAutoLogAppEventsEnabled(true);
//FBSDKAppEvents.logEvent("Registered");
}
}
catch(e){
console.log(e);
}
}
};