Skip to content

Commit f8d0a93

Browse files
authored
fix(apple-sign-in): presentationcontext and sha handling (#656)
1 parent 1c6e5fc commit f8d0a93

File tree

2 files changed

+347
-269
lines changed

2 files changed

+347
-269
lines changed

packages/apple-sign-in/index.d.ts

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,57 @@
11
import { UserDetectionStatus } from './common';
22
import { View } from '@nativescript/core';
33

4-
export class SignInButton extends View { }
5-
4+
export type SignInButtonType = 'default' | 'signUp' | 'continue';
5+
export type SignInButtonStyle = 'white' | 'whiteOutline' | 'black';
6+
7+
export class SignInButton extends View {
8+
/**
9+
* Button type: 'default' (Sign in with Apple), 'signUp' (Sign up with Apple), 'continue' (Continue with Apple)
10+
*/
11+
type: SignInButtonType;
12+
/**
13+
* Button style: 'white', 'whiteOutline', 'black'
14+
*/
15+
buttonStyle: SignInButtonStyle;
16+
}
617

7-
export type SignInScopes = "EMAIL" | "FULL_NAME";
18+
export type SignInScopes = 'EMAIL' | 'FULL_NAME';
819

920
export interface SignInOptions {
10-
user?: string;
11-
scopes?: SignInScopes[],
12-
useNonce?: boolean,
13-
nonce?: string
21+
user?: string;
22+
scopes?: SignInScopes[];
23+
useNonce?: boolean;
24+
nonce?: string;
1425
}
1526

1627
export interface UserFullName {
17-
namePrefix?: string,
18-
givenName?: string,
19-
middleName?: string,
20-
familyName?: string,
21-
nameSuffix?: string,
22-
nickname?: string
28+
namePrefix?: string;
29+
givenName?: string;
30+
middleName?: string;
31+
familyName?: string;
32+
nameSuffix?: string;
33+
nickname?: string;
2334
}
2435

2536
export interface User {
26-
nonce?: string,
27-
user: string,
28-
fullName?: UserFullName,
29-
realUserStatus: UserDetectionStatus,
30-
authorizedScopes: SignInScopes[],
31-
identityToken?: string,
32-
email?: string,
33-
state: string,
34-
authorizationCode?: string
37+
nonce?: string;
38+
user: string;
39+
fullName?: UserFullName;
40+
realUserStatus: UserDetectionStatus;
41+
authorizedScopes: SignInScopes[];
42+
identityToken?: string;
43+
email?: string;
44+
state: string;
45+
authorizationCode?: string;
3546
}
3647

3748
export class SignIn {
38-
static #controller: ASAuthorizationController;
39-
static #delegate: ASAuthorizationControllerDelegate;
49+
static #controller: ASAuthorizationController;
50+
static #delegate: ASAuthorizationControllerDelegate;
4051

41-
public static signIn(
42-
options?: SignInOptions
43-
): Promise<User>;
52+
public static signIn(options?: SignInOptions): Promise<User>;
4453

45-
public static isSupported(): boolean;
54+
public static isSupported(): boolean;
4655

47-
public static getState(userID: string): Promise<CredentialState>;
56+
public static getState(userID: string): Promise<CredentialState>;
4857
}

0 commit comments

Comments
 (0)