Skip to content

Commit d3f1784

Browse files
author
Dimitar Tachev
authored
Merge pull request #37 from NativeScript/tachev/fix-fb-app-integration
Updated the Facebook android SDK to its latest version. Removed the logout call on loaded.
2 parents 17580ce + 1aaa4e4 commit d3f1784

File tree

8 files changed

+69
-93
lines changed

8 files changed

+69
-93
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,5 +465,8 @@ This sample is part of the demo apps and can be observed [here](https://github.c
465465
* NativeScript 3.0 ready
466466
* Webpack ready
467467
468+
## FAQ
469+
Check out our FAQ section [here](https://github.com/NativeScript/nativescript-facebook/wiki/FAQ).
470+
468471
## License
469472
[Apache 2.0](https://github.com/NativeScript/nativescript-facebook/blob/master/LICENSE)

src/login-manager.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export function _registerLogoutCallback(callback: Function) {
1616
}
1717

1818
export function init(fbId: string) {
19+
com.facebook.FacebookSdk.setAutoLogAppEventsEnabled(true);
1920
setAppId(fbId);
2021
androidApplication = application.android;
2122
try {
@@ -27,7 +28,6 @@ export function init(fbId: string) {
2728
}
2829
onLoginCallback = com.facebook.CallbackManager.Factory.create();
2930
loginManager = com.facebook.login.LoginManager.getInstance();
30-
loginManager.logOut();
3131

3232
// Workaround for firing the logout event in android:
3333
// https://stackoverflow.com/questions/30233284/how-to-add-a-logout-callback-for-facebook-sdk-in-android

src/login-manager.ios.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export function init(fbId: string) {
2222
setAppId(fbId);
2323
loginManager = FBSDKLoginManager.alloc().init();
2424
loginManager.loginBehavior = FB_LOGIN_BEHAVIOUR;
25-
loginManager.logOut();
2625
}
2726

2827
export function _registerLogoutCallback(callback: Function) {

src/package.json

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
11
{
2-
"name": "nativescript-facebook",
3-
"version": "2.0.0",
4-
"description": "NativeScript plugin, wrapper of native Facebook SDK for Adroid and iOS.",
5-
"nativescript": {
6-
"platforms": {
7-
"android": "3.0.0",
8-
"ios": "3.0.0"
9-
}
10-
},
11-
"scripts": {
12-
"build": "tsc",
13-
"ci.tslint": "tslint *.ts && tslint ../demo/app/*.ts && tslint ../demo-angular/app/*.ts",
14-
"ci.android": "cd ../demo && tns build android",
15-
"ci.ios": "cd ../demo && tns build ios",
16-
"ci.test.ios": "cd ../demo && tns platform remove ios && tns test ios",
17-
"ci.test.android": "cd ../demo && tns platform remove android && tns test android",
18-
"ci.test.ios.angular": "cd ../demo-angular && tns platform remove ios && tns test ios",
19-
"ci.test.android.angular": "cd ../demo-angular && tns platform remove android",
20-
"prepublish": "npm run build"
21-
},
22-
"repository": {
23-
"type": "git",
24-
"url": "https://github.com/NativeScript/nativescript-facebook.git"
25-
},
26-
"keywords": [
27-
"NativeScript",
28-
"TypeScript",
29-
"Android",
30-
"iOS",
31-
"Facebook"
32-
],
33-
"author": {
34-
"name": "NativeScript Team",
35-
"email": "support@telerik.com",
36-
"url": "http://www.telerik.com"
37-
},
38-
"maintainers": [{
39-
"name": "angeltsvetkov",
40-
"email": "angel.tsvetkov@progress.com"
2+
"name": "nativescript-facebook",
3+
"version": "2.0.1",
4+
"description": "NativeScript plugin, wrapper of native Facebook SDK for Adroid and iOS.",
5+
"nativescript": {
6+
"platforms": {
7+
"android": "3.0.0",
8+
"ios": "3.0.0"
9+
}
10+
},
11+
"scripts": {
12+
"build": "tsc",
13+
"ci.tslint": "tslint *.ts && tslint ../demo/app/*.ts && tslint ../demo-angular/app/*.ts",
14+
"ci.android": "cd ../demo && tns build android",
15+
"ci.ios": "cd ../demo && tns build ios",
16+
"ci.test.ios": "cd ../demo && tns platform remove ios && tns test ios",
17+
"ci.test.android": "cd ../demo && tns platform remove android && tns test android",
18+
"ci.test.ios.angular": "cd ../demo-angular && tns platform remove ios && tns test ios",
19+
"ci.test.android.angular": "cd ../demo-angular && tns platform remove android",
20+
"prepublish": "npm run build"
21+
},
22+
"repository": {
23+
"type": "git",
24+
"url": "https://github.com/NativeScript/nativescript-facebook.git"
25+
},
26+
"keywords": [
27+
"NativeScript",
28+
"TypeScript",
29+
"Android",
30+
"iOS",
31+
"Facebook"
32+
],
33+
"author": {
34+
"name": "NativeScript Team",
35+
"email": "support@telerik.com",
36+
"url": "http://www.telerik.com"
37+
},
38+
"maintainers": [{
39+
"name": "angeltsvetkov",
40+
"email": "angel.tsvetkov@progress.com"
41+
},
42+
{
43+
"name": "Dimitar Tachev",
44+
"email": "dimitar.tachev@progress.com"
45+
}
46+
],
47+
"bugs": {
48+
"url": "https://github.com/NativeScript/nativescript-facebook/issues"
49+
},
50+
"license": "Apache 2.0",
51+
"homepage": "https://github.com/NativeScript/nativescript-facebook",
52+
"readmeFilename": "README.md",
53+
"devDependencies": {
54+
"tns-core-modules": "^3.0.0",
55+
"tns-platform-declarations": "^3.0.0",
56+
"typescript": "~2.2.2",
57+
"nativescript-angular": "^3.0.0 || ^2.0.0-rc.1",
58+
"@angular/core": "~4.0.1",
59+
"@angular/common": "~4.0.1",
60+
"@angular/compiler": "~4.0.1",
61+
"@angular/compiler-cli": "~4.0.1",
62+
"rxjs": "~5.3.0",
63+
"zone.js": "~0.8.4"
4164
},
42-
{
43-
"name": "Dimitar Tachev",
44-
"email": "dimitar.tachev@progress.com"
65+
"peerDependencies": {
66+
"tns-core-modules": "^3.0.0"
4567
}
46-
],
47-
"bugs": {
48-
"url": "https://github.com/NativeScript/nativescript-facebook/issues"
49-
},
50-
"license": "Apache 2.0",
51-
"homepage": "https://github.com/NativeScript/nativescript-facebook",
52-
"readmeFilename": "README.md",
53-
"devDependencies": {
54-
"tns-core-modules": "^3.0.0",
55-
"tns-platform-declarations": "^3.0.0",
56-
"typescript": "~2.2.2",
57-
"nativescript-angular": "^3.0.0 || ^2.0.0-rc.1",
58-
"@angular/core": "~4.0.1",
59-
"@angular/common": "~4.0.1",
60-
"@angular/compiler": "~4.0.1",
61-
"@angular/compiler-cli": "~4.0.1",
62-
"rxjs": "~5.3.0",
63-
"zone.js": "~0.8.4"
64-
},
65-
"peerDependencies": {
66-
"tns-core-modules": "^3.0.0"
67-
}
6868
}
Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3-
4-
<!--Describe the permissions, features or other configurations required by your plugin for Android.
5-
To read more about android permissions go to https://developer.android.com/guide/topics/permissions/index.html -->
6-
<!--EXAMPLE: uses-permission android:name="android.permission.INTERNET"/> -->
7-
83
<uses-permission android:name="android.permission.INTERNET"/>
9-
<application>
10-
<!--<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>-->
11-
<activity android:name="com.facebook.FacebookActivity"
12-
android:configChanges=
13-
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
14-
android:theme="@android:style/Theme.Translucent.NoTitleBar"
15-
android:label="@string/app_name" />
16-
</application>
17-
18-
194
</manifest>

src/platforms/android/README.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/platforms/android/include.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@ android {
99
}
1010

1111
dependencies {
12-
// Describe plugin native Android dependencies like
13-
// compile "groupName:pluginName:ver"
14-
// EXAMPLE: compile "com.facebook.fresco:fresco:0.9.0+"
12+
compile "com.facebook.android:facebook-android-sdk:4.22.0"
1513
}
-764 KB
Binary file not shown.

0 commit comments

Comments
 (0)