Skip to content

Commit 6ab4f7b

Browse files
committed
Merge branch 'main' into feat/theme-switcher
2 parents 4d8d7c6 + 1b47088 commit 6ab4f7b

File tree

11 files changed

+925
-342
lines changed

11 files changed

+925
-342
lines changed

packages/facebook/index.android.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export class LoginManager implements ILoginManager {
183183

184184
static init(){}
185185

186-
static logInWithPermissions(permissions: string[]): Promise<LoginResult> {
186+
static logInWithPermissions(permissions: string[], context?: any): Promise<LoginResult> {
187187
return new Promise((resolve, reject) => {
188188
if (!this.#native) {
189189
this.#native = com.facebook.login.LoginManager.getInstance();
@@ -206,7 +206,7 @@ export class LoginManager implements ILoginManager {
206206
},
207207
})
208208
);
209-
this.#native.logIn(Application.android.foregroundActivity || Application.android.startActivity, java.util.Arrays.asList(permissions));
209+
this.#native.logIn(<android.app.Activity>context || Application.android.foregroundActivity || Application.android.startActivity, java.util.Arrays.asList(permissions));
210210
});
211211
}
212212

packages/facebook/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export declare class LoginResult implements ILoginResult {
5858
export declare class LoginManager implements ILoginManager {
5959
static init();
6060

61-
static logInWithPermissions(permissions: string[]): Promise<LoginResult>;
61+
static logInWithPermissions(permissions: string[], context?: any /* UIViewController to open from on iOS, Activity to open with on Android */): Promise<LoginResult>;
6262

6363
static logout();
6464
}

packages/facebook/index.ios.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ export class AccessToken {
9595
return this.#expiredPermissions;
9696
}
9797

98-
get graphDomain(): string {
99-
return this.native.graphDomain;
100-
}
101-
10298
get permissions(): string[] {
10399
if (!this.#permissions) {
104100
this.#permissions = setToArray(this.native.permissions);
@@ -198,9 +194,9 @@ export class LoginManager implements ILoginManager {
198194
}
199195
}
200196

201-
static logInWithPermissions(permissions: string[]): Promise<LoginResult> {
197+
static logInWithPermissions(permissions: string[], context?: any): Promise<LoginResult> {
202198
return new Promise((resolve, reject) => {
203-
this.#native.logInWithPermissionsFromViewControllerHandler(permissions, this.topViewController, (result, error) => {
199+
this.#native.logInWithPermissionsFromViewControllerHandler(NSArray.arrayWithArray(permissions), <UIViewController>context || this.topViewController, (result, error) => {
204200
if (error) {
205201
reject(FacebookError.fromNative(error));
206202
} else {

packages/facebook/package.json

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
{
2-
"name": "@nativescript/facebook",
3-
"version": "1.0.0-alpha.1",
4-
"description": "Facebook for your NativeScript applications",
5-
"main": "index",
6-
"typings": "index.d.ts",
7-
"nativescript": {
8-
"platforms": {
9-
"ios": "6.0.0",
10-
"android": "6.0.0"
11-
}
12-
},
13-
"repository": {
14-
"type": "git",
15-
"url": "https://github.com/NativeScript/plugins.git"
16-
},
17-
"keywords": [
18-
"NativeScript",
19-
"JavaScript",
20-
"TypeScript",
21-
"iOS",
22-
"Android"
23-
],
24-
"author": {
25-
"name": "NativeScript",
26-
"email": "oss@nativescript.org"
27-
},
28-
"bugs": {
29-
"url": "https://github.com/NativeScript/plugins/issues"
30-
},
31-
"license": "Apache-2.0",
32-
"homepage": "https://github.com/NativeScript/plugins",
33-
"readmeFilename": "README.md",
34-
"bootstrapper": "@nativescript/plugin-seed"
2+
"name": "@nativescript/facebook",
3+
"version": "1.0.0-alpha.3",
4+
"description": "Facebook for your NativeScript applications",
5+
"main": "index",
6+
"typings": "index.d.ts",
7+
"nativescript": {
8+
"platforms": {
9+
"ios": "6.0.0",
10+
"android": "6.0.0"
11+
}
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "https://github.com/NativeScript/plugins.git"
16+
},
17+
"keywords": [
18+
"NativeScript",
19+
"JavaScript",
20+
"TypeScript",
21+
"iOS",
22+
"Android"
23+
],
24+
"author": {
25+
"name": "NativeScript",
26+
"email": "oss@nativescript.org"
27+
},
28+
"bugs": {
29+
"url": "https://github.com/NativeScript/plugins/issues"
30+
},
31+
"license": "Apache-2.0",
32+
"homepage": "https://github.com/NativeScript/plugins",
33+
"readmeFilename": "README.md",
34+
"bootstrapper": "@nativescript/plugin-seed"
3535
}

packages/facebook/platforms/android/include.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ repositories {
33
}
44

55
dependencies {
6-
implementation 'com.facebook.android:facebook-core:11.2.0'
7-
implementation 'com.facebook.android:facebook-login:11.2.0'
6+
implementation 'com.facebook.android:facebook-core:12.0.0'
7+
implementation 'com.facebook.android:facebook-login:12.0.0'
88
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
pod 'FBSDKCoreKit', '~> 11.2'
2-
pod 'FBSDKLoginKit', '~> 11.2'
1+
pod 'FBSDKCoreKit', '~> 12.0.2'
2+
pod 'FBSDKLoginKit', '~> 12.0.2'
33
pod 'GoogleUtilities', '~> 7.5'

packages/facebook/references.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
/// <reference path="../../references.d.ts" />
1+
/// <reference path="../../references.d.ts" />
2+
/// <reference path="./typings/android.d.ts" />
3+
/// <reference path="./typings/objc!FBSDKCoreKit_Basics.d.ts" />
4+
/// <reference path="./typings/objc!FBSDKCoreKit.d.ts" />
5+
/// <reference path="./typings/objc!FBSDKLoginKit.d.ts" />

0 commit comments

Comments
 (0)