expo-apple-authentication 4.1.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,18 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 4.3.0 — 2022-07-07
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Android: Warnings about `new NativeEventEmitter()` no longer appear when using React Native v0.65+. ([#17343](https://github.com/expo/expo/pull/17343) by [@chrisbobbe](https://github.com/chrisbobbe))
18
+
19
+ ## 4.2.0 — 2022-04-18
20
+
21
+ ### 💡 Others
22
+
23
+ - Updated `@expo/config-plugins` from `4.0.2` to `4.0.14` ([#15621](https://github.com/expo/expo/pull/15621) by [@EvanBacon](https://github.com/EvanBacon))
24
+
13
25
  ## 4.1.0 — 2021-12-03
14
26
 
15
27
  _This version does not introduce any user-facing changes._
package/README.md CHANGED
@@ -4,12 +4,12 @@ This library provides Apple authentication for iOS standalone apps in the manage
4
4
 
5
5
  # API documentation
6
6
 
7
- - [Documentation for the master branch](https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/sdk/apple-authentication.md)
8
- - [Documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/apple-authentication/)
7
+ - [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/apple-authentication.md)
8
+ - [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/apple-authentication/)
9
9
 
10
10
  # Installation in managed Expo projects
11
11
 
12
- For managed [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/apple-authentication/).
12
+ For [managed](https://docs.expo.dev/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/apple-authentication/).
13
13
 
14
14
  # Installation in bare React Native projects
15
15
 
@@ -25,7 +25,29 @@ export declare function isAvailableAsync(): Promise<boolean>;
25
25
  * sign-in operation.
26
26
  */
27
27
  export declare function signInAsync(options?: AppleAuthenticationSignInOptions): Promise<AppleAuthenticationCredential>;
28
+ /**
29
+ * An operation that refreshes the logged-in user’s credentials.
30
+ * Calling this method will show the sign in modal before actually refreshing the user credentials.
31
+ *
32
+ * @param options An [`AppleAuthenticationRefreshOptions`](#appleauthenticationrefreshoptions) object
33
+ * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)
34
+ * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the
35
+ * refresh operation.
36
+ */
28
37
  export declare function refreshAsync(options: AppleAuthenticationRefreshOptions): Promise<AppleAuthenticationCredential>;
38
+ /**
39
+ * An operation that ends the authenticated session.
40
+ * Calling this method will show the sign in modal before actually signing the user out.
41
+ *
42
+ * It is not recommended to use this method to sign out the user as it works counterintuitively.
43
+ * Instead of using this method it is recommended to simply clear all the user's data collected
44
+ * from using [`signInAsync`](./#signinasync) or [`refreshAsync`](./#refreshasync) methods.
45
+ *
46
+ * @param options An [`AppleAuthenticationSignOutOptions`](#appleauthenticationsignoutoptions) object
47
+ * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)
48
+ * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the
49
+ * sign-out operation.
50
+ */
29
51
  export declare function signOutAsync(options: AppleAuthenticationSignOutOptions): Promise<AppleAuthenticationCredential>;
30
52
  /**
31
53
  * Queries the current state of a user credential, to determine if it is still valid or if it has been revoked.
@@ -39,3 +61,4 @@ export declare function signOutAsync(options: AppleAuthenticationSignOutOptions)
39
61
  export declare function getCredentialStateAsync(user: string): Promise<AppleAuthenticationCredentialState>;
40
62
  export declare function addRevokeListener(listener: () => void): Subscription;
41
63
  export { Subscription };
64
+ //# sourceMappingURL=AppleAuthentication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppleAuthentication.d.ts","sourceRoot":"","sources":["../src/AppleAuthentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAuB,MAAM,mBAAmB,CAAC;AAEhG,OAAO,EACL,6BAA6B,EAC7B,kCAAkC,EAElC,iCAAiC,EACjC,gCAAgC,EAChC,iCAAiC,EAClC,MAAM,6BAA6B,CAAC;AAIrC;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAKzD;AAGD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,WAAW,CAC/B,OAAO,CAAC,EAAE,gCAAgC,GACzC,OAAO,CAAC,6BAA6B,CAAC,CAgBxC;AAGD;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,iCAAiC,GACzC,OAAO,CAAC,6BAA6B,CAAC,CAgBxC;AAGD;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,iCAAiC,GACzC,OAAO,CAAC,6BAA6B,CAAC,CASxC;AAGD;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,kCAAkC,CAAC,CAK7C;AAKD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,YAAY,CAEpE;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -46,7 +46,16 @@ export async function signInAsync(options) {
46
46
  }
47
47
  return credential;
48
48
  }
49
- // @docsMissing
49
+ // @needsAudit
50
+ /**
51
+ * An operation that refreshes the logged-in user’s credentials.
52
+ * Calling this method will show the sign in modal before actually refreshing the user credentials.
53
+ *
54
+ * @param options An [`AppleAuthenticationRefreshOptions`](#appleauthenticationrefreshoptions) object
55
+ * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)
56
+ * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the
57
+ * refresh operation.
58
+ */
50
59
  export async function refreshAsync(options) {
51
60
  if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {
52
61
  throw new UnavailabilityError('expo-apple-authentication', 'refreshAsync');
@@ -61,7 +70,20 @@ export async function refreshAsync(options) {
61
70
  }
62
71
  return credential;
63
72
  }
64
- // @docsMissing
73
+ // @needsAudit
74
+ /**
75
+ * An operation that ends the authenticated session.
76
+ * Calling this method will show the sign in modal before actually signing the user out.
77
+ *
78
+ * It is not recommended to use this method to sign out the user as it works counterintuitively.
79
+ * Instead of using this method it is recommended to simply clear all the user's data collected
80
+ * from using [`signInAsync`](./#signinasync) or [`refreshAsync`](./#refreshasync) methods.
81
+ *
82
+ * @param options An [`AppleAuthenticationSignOutOptions`](#appleauthenticationsignoutoptions) object
83
+ * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)
84
+ * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the
85
+ * sign-out operation.
86
+ */
65
87
  export async function signOutAsync(options) {
66
88
  if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {
67
89
  throw new UnavailabilityError('expo-apple-authentication', 'signOutAsync');
@@ -1 +1 @@
1
- {"version":3,"file":"AppleAuthentication.js","sourceRoot":"","sources":["../src/AppleAuthentication.ts"],"names":[],"mappings":"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","sourcesContent":["import { CodedError, EventEmitter, Subscription, UnavailabilityError } from 'expo-modules-core';\n\nimport {\n AppleAuthenticationCredential,\n AppleAuthenticationCredentialState,\n AppleAuthenticationOperation,\n AppleAuthenticationRefreshOptions,\n AppleAuthenticationSignInOptions,\n AppleAuthenticationSignOutOptions,\n} from './AppleAuthentication.types';\nimport ExpoAppleAuthentication from './ExpoAppleAuthentication';\n\n// @needsAudit\n/**\n * Determine if the current device's operating system supports Apple authentication.\n * @return A promise that fulfills with `true` if the system supports Apple authentication, and `false` otherwise.\n */\nexport async function isAvailableAsync(): Promise<boolean> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.isAvailableAsync) {\n return false;\n }\n return ExpoAppleAuthentication.isAvailableAsync();\n}\n\n// @needsAudit\n/**\n * Sends a request to the operating system to initiate the Apple authentication flow, which will\n * present a modal to the user over your app and allow them to sign in.\n *\n * You can request access to the user's full name and email address in this method, which allows you\n * to personalize your UI for signed in users. However, users can deny access to either or both\n * of these options at runtime.\n *\n * Additionally, you will only receive Apple Authentication Credentials the first time users sign\n * into your app, so you must store it for later use. It's best to store this information either\n * server-side, or using [SecureStore](./securestore), so that the data persists across app installs.\n * You can use [`AppleAuthenticationCredential.user`](#appleauthenticationcredential) to identify\n * the user, since this remains the same for apps released by the same developer.\n *\n * @param options An optional [`AppleAuthenticationSignInOptions`](#appleauthenticationsigninoptions) object\n * @return A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)\n * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the\n * sign-in operation.\n */\nexport async function signInAsync(\n options?: AppleAuthenticationSignInOptions\n): Promise<AppleAuthenticationCredential> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'signInAsync');\n }\n const requestOptions = {\n ...options,\n requestedOperation: AppleAuthenticationOperation.LOGIN,\n };\n const credential = await ExpoAppleAuthentication.requestAsync(requestOptions);\n if (!credential.authorizationCode || !credential.identityToken || !credential.user) {\n throw new CodedError(\n 'ERR_APPLE_AUTHENTICATION_REQUEST_FAILED',\n 'The credential returned by `signInAsync` is missing one or more required fields.'\n );\n }\n return credential;\n}\n\n// @docsMissing\nexport async function refreshAsync(\n options: AppleAuthenticationRefreshOptions\n): Promise<AppleAuthenticationCredential> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'refreshAsync');\n }\n const requestOptions = {\n ...options,\n requestedOperation: AppleAuthenticationOperation.REFRESH,\n };\n const credential = await ExpoAppleAuthentication.requestAsync(requestOptions);\n if (!credential.authorizationCode || !credential.identityToken || !credential.user) {\n throw new CodedError(\n 'ERR_APPLE_AUTHENTICATION_REQUEST_FAILED',\n 'The credential returned by `refreshAsync` is missing one or more required fields.'\n );\n }\n return credential;\n}\n\n// @docsMissing\nexport async function signOutAsync(\n options: AppleAuthenticationSignOutOptions\n): Promise<AppleAuthenticationCredential> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'signOutAsync');\n }\n const requestOptions = {\n ...options,\n requestedOperation: AppleAuthenticationOperation.LOGOUT,\n };\n return ExpoAppleAuthentication.requestAsync(requestOptions);\n}\n\n// @needsAudit\n/**\n * Queries the current state of a user credential, to determine if it is still valid or if it has been revoked.\n * > **Note:** This method must be tested on a real device. On the iOS simulator it always throws an error.\n *\n * @param user The unique identifier for the user whose credential state you'd like to check.\n * This should come from the user field of an [`AppleAuthenticationCredential`](#appleauthenticationcredentialstate) object.\n * @return A promise that fulfills with an [`AppleAuthenticationCredentialState`](#appleauthenticationcredentialstate)\n * value depending on the state of the credential.\n */\nexport async function getCredentialStateAsync(\n user: string\n): Promise<AppleAuthenticationCredentialState> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.getCredentialStateAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'getCredentialStateAsync');\n }\n return ExpoAppleAuthentication.getCredentialStateAsync(user);\n}\n\nconst ExpoAppleAuthenticationEventEmitter = new EventEmitter(ExpoAppleAuthentication);\n\n// @docsMissing\nexport function addRevokeListener(listener: () => void): Subscription {\n return ExpoAppleAuthenticationEventEmitter.addListener('Expo.appleIdCredentialRevoked', listener);\n}\n\nexport { Subscription };\n"]}
1
+ {"version":3,"file":"AppleAuthentication.js","sourceRoot":"","sources":["../src/AppleAuthentication.ts"],"names":[],"mappings":"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","sourcesContent":["import { CodedError, EventEmitter, Subscription, UnavailabilityError } from 'expo-modules-core';\n\nimport {\n AppleAuthenticationCredential,\n AppleAuthenticationCredentialState,\n AppleAuthenticationOperation,\n AppleAuthenticationRefreshOptions,\n AppleAuthenticationSignInOptions,\n AppleAuthenticationSignOutOptions,\n} from './AppleAuthentication.types';\nimport ExpoAppleAuthentication from './ExpoAppleAuthentication';\n\n// @needsAudit\n/**\n * Determine if the current device's operating system supports Apple authentication.\n * @return A promise that fulfills with `true` if the system supports Apple authentication, and `false` otherwise.\n */\nexport async function isAvailableAsync(): Promise<boolean> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.isAvailableAsync) {\n return false;\n }\n return ExpoAppleAuthentication.isAvailableAsync();\n}\n\n// @needsAudit\n/**\n * Sends a request to the operating system to initiate the Apple authentication flow, which will\n * present a modal to the user over your app and allow them to sign in.\n *\n * You can request access to the user's full name and email address in this method, which allows you\n * to personalize your UI for signed in users. However, users can deny access to either or both\n * of these options at runtime.\n *\n * Additionally, you will only receive Apple Authentication Credentials the first time users sign\n * into your app, so you must store it for later use. It's best to store this information either\n * server-side, or using [SecureStore](./securestore), so that the data persists across app installs.\n * You can use [`AppleAuthenticationCredential.user`](#appleauthenticationcredential) to identify\n * the user, since this remains the same for apps released by the same developer.\n *\n * @param options An optional [`AppleAuthenticationSignInOptions`](#appleauthenticationsigninoptions) object\n * @return A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)\n * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the\n * sign-in operation.\n */\nexport async function signInAsync(\n options?: AppleAuthenticationSignInOptions\n): Promise<AppleAuthenticationCredential> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'signInAsync');\n }\n const requestOptions = {\n ...options,\n requestedOperation: AppleAuthenticationOperation.LOGIN,\n };\n const credential = await ExpoAppleAuthentication.requestAsync(requestOptions);\n if (!credential.authorizationCode || !credential.identityToken || !credential.user) {\n throw new CodedError(\n 'ERR_APPLE_AUTHENTICATION_REQUEST_FAILED',\n 'The credential returned by `signInAsync` is missing one or more required fields.'\n );\n }\n return credential;\n}\n\n// @needsAudit\n/**\n * An operation that refreshes the logged-in user’s credentials.\n * Calling this method will show the sign in modal before actually refreshing the user credentials.\n *\n * @param options An [`AppleAuthenticationRefreshOptions`](#appleauthenticationrefreshoptions) object\n * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)\n * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the\n * refresh operation.\n */\nexport async function refreshAsync(\n options: AppleAuthenticationRefreshOptions\n): Promise<AppleAuthenticationCredential> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'refreshAsync');\n }\n const requestOptions = {\n ...options,\n requestedOperation: AppleAuthenticationOperation.REFRESH,\n };\n const credential = await ExpoAppleAuthentication.requestAsync(requestOptions);\n if (!credential.authorizationCode || !credential.identityToken || !credential.user) {\n throw new CodedError(\n 'ERR_APPLE_AUTHENTICATION_REQUEST_FAILED',\n 'The credential returned by `refreshAsync` is missing one or more required fields.'\n );\n }\n return credential;\n}\n\n// @needsAudit\n/**\n * An operation that ends the authenticated session.\n * Calling this method will show the sign in modal before actually signing the user out.\n *\n * It is not recommended to use this method to sign out the user as it works counterintuitively.\n * Instead of using this method it is recommended to simply clear all the user's data collected\n * from using [`signInAsync`](./#signinasync) or [`refreshAsync`](./#refreshasync) methods.\n *\n * @param options An [`AppleAuthenticationSignOutOptions`](#appleauthenticationsignoutoptions) object\n * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)\n * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the\n * sign-out operation.\n */\nexport async function signOutAsync(\n options: AppleAuthenticationSignOutOptions\n): Promise<AppleAuthenticationCredential> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'signOutAsync');\n }\n const requestOptions = {\n ...options,\n requestedOperation: AppleAuthenticationOperation.LOGOUT,\n };\n return ExpoAppleAuthentication.requestAsync(requestOptions);\n}\n\n// @needsAudit\n/**\n * Queries the current state of a user credential, to determine if it is still valid or if it has been revoked.\n * > **Note:** This method must be tested on a real device. On the iOS simulator it always throws an error.\n *\n * @param user The unique identifier for the user whose credential state you'd like to check.\n * This should come from the user field of an [`AppleAuthenticationCredential`](#appleauthenticationcredentialstate) object.\n * @return A promise that fulfills with an [`AppleAuthenticationCredentialState`](#appleauthenticationcredentialstate)\n * value depending on the state of the credential.\n */\nexport async function getCredentialStateAsync(\n user: string\n): Promise<AppleAuthenticationCredentialState> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.getCredentialStateAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'getCredentialStateAsync');\n }\n return ExpoAppleAuthentication.getCredentialStateAsync(user);\n}\n\nconst ExpoAppleAuthenticationEventEmitter = new EventEmitter(ExpoAppleAuthentication);\n\n// @docsMissing\nexport function addRevokeListener(listener: () => void): Subscription {\n return ExpoAppleAuthenticationEventEmitter.addListener('Expo.appleIdCredentialRevoked', listener);\n}\n\nexport { Subscription };\n"]}
@@ -231,7 +231,8 @@ export declare enum AppleAuthenticationButtonType {
231
231
  */
232
232
  CONTINUE = 1,
233
233
  /**
234
- * "Sign up with Apple" *(requires iOS 13.2 or higher)*
234
+ * "Sign up with Apple"
235
+ * @platform ios 13.2+
235
236
  */
236
237
  SIGN_UP = 2
237
238
  }
@@ -252,3 +253,4 @@ export declare enum AppleAuthenticationButtonStyle {
252
253
  */
253
254
  BLACK = 2
254
255
  }
256
+ //# sourceMappingURL=AppleAuthentication.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppleAuthentication.types.d.ts","sourceRoot":"","sources":["../src/AppleAuthentication.types.ts"],"names":[],"mappings":"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"}
@@ -78,7 +78,8 @@ export var AppleAuthenticationButtonType;
78
78
  */
79
79
  AppleAuthenticationButtonType[AppleAuthenticationButtonType["CONTINUE"] = 1] = "CONTINUE";
80
80
  /**
81
- * "Sign up with Apple" *(requires iOS 13.2 or higher)*
81
+ * "Sign up with Apple"
82
+ * @platform ios 13.2+
82
83
  */
83
84
  AppleAuthenticationButtonType[AppleAuthenticationButtonType["SIGN_UP"] = 2] = "SIGN_UP";
84
85
  })(AppleAuthenticationButtonType || (AppleAuthenticationButtonType = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"AppleAuthentication.types.js","sourceRoot":"","sources":["../src/AppleAuthentication.types.ts"],"names":[],"mappings":"AA2LA,2BAA2B;AAC3B;;;;;;;;;GASG;AACH,MAAM,CAAN,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,iFAAa,CAAA;IACb,yEAAS,CAAA;AACX,CAAC,EAHW,wBAAwB,KAAxB,wBAAwB,QAGnC;AAED,2BAA2B;AAC3B,MAAM,CAAN,IAAY,4BAQX;AARD,WAAY,4BAA4B;IACtC;;OAEG;IACH,uFAAY,CAAA;IACZ,iFAAS,CAAA;IACT,qFAAW,CAAA;IACX,mFAAU,CAAA;AACZ,CAAC,EARW,4BAA4B,KAA5B,4BAA4B,QAQvC;AAED,2BAA2B;AAC3B;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,kCAKX;AALD,WAAY,kCAAkC;IAC5C,iGAAW,CAAA;IACX,uGAAc,CAAA;IACd,qGAAa,CAAA;IACb,yGAAe,CAAA;AACjB,CAAC,EALW,kCAAkC,KAAlC,kCAAkC,QAK7C;AAED,cAAc;AACd;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,sCAaX;AAbD,WAAY,sCAAsC;IAChD;;OAEG;IACH,iHAAe,CAAA;IACf;;OAEG;IACH,yGAAW,CAAA;IACX;;OAEG;IACH,iHAAe,CAAA;AACjB,CAAC,EAbW,sCAAsC,KAAtC,sCAAsC,QAajD;AAED,cAAc;AACd;;GAEG;AACH,MAAM,CAAN,IAAY,6BAaX;AAbD,WAAY,6BAA6B;IACvC;;OAEG;IACH,uFAAW,CAAA;IACX;;OAEG;IACH,yFAAY,CAAA;IACZ;;OAEG;IACH,uFAAW,CAAA;AACb,CAAC,EAbW,6BAA6B,KAA7B,6BAA6B,QAaxC;AAED,cAAc;AACd;;GAEG;AACH,MAAM,CAAN,IAAY,8BAaX;AAbD,WAAY,8BAA8B;IACxC;;OAEG;IACH,qFAAS,CAAA;IACT;;OAEG;IACH,qGAAiB,CAAA;IACjB;;OAEG;IACH,qFAAS,CAAA;AACX,CAAC,EAbW,8BAA8B,KAA9B,8BAA8B,QAazC","sourcesContent":["import { StyleProp, ViewStyle, ViewProps } from 'react-native';\n\n// @needsAudit\nexport declare type AppleAuthenticationButtonProps = ViewProps & {\n /**\n * The method to call when the user presses the button. You should call [`AppleAuthentication.signInAsync`](#isavailableasync)\n * in here.\n */\n onPress: () => void;\n /**\n * The type of button text to display (\"Sign In with Apple\" vs. \"Continue with Apple\").\n */\n buttonType: AppleAuthenticationButtonType;\n /**\n * The Apple-defined color scheme to use to display the button.\n */\n buttonStyle: AppleAuthenticationButtonStyle;\n /**\n * The border radius to use when rendering the button. This works similarly to\n * `style.borderRadius` in other Views.\n */\n cornerRadius?: number;\n /**\n * The custom style to apply to the button. Should not include `backgroundColor` or `borderRadius`\n * properties.\n */\n style?: StyleProp<Omit<ViewStyle, 'backgroundColor' | 'borderRadius'>>;\n};\n\n// @needsAudit\n/**\n * The options you can supply when making a call to [`AppleAuthentication.signInAsync()`](#appleauthenticationsigninasyncoptions).\n * None of these options are required.\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationopenidrequest)\n * for more details.\n */\nexport type AppleAuthenticationSignInOptions = {\n /**\n * Array of user information scopes to which your app is requesting access. Note that the user can\n * choose to deny your app access to any scope at the time of logging in. You will still need to\n * handle `null` values for any scopes you request. Additionally, note that the requested scopes\n * will only be provided to you the first time each user signs into your app; in subsequent\n * requests they will be `null`. Defaults to `[]` (no scopes).\n */\n requestedScopes?: AppleAuthenticationScope[];\n\n /**\n * An arbitrary string that is returned unmodified in the corresponding credential after a\n * successful authentication. This can be used to verify that the response was from the request\n * you made and avoid replay attacks. More information on this property is available in the\n * OAuth 2.0 protocol [RFC6749](https://tools.ietf.org/html/rfc6749#section-10.12).\n */\n state?: string;\n\n /**\n * An arbitrary string that is used to prevent replay attacks. See more information on this in the\n * [OpenID Connect specification](https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowSteps).\n */\n nonce?: string;\n};\n\n// @needsAudit @docsMissing\n/**\n * The options you can supply when making a call to [`AppleAuthentication.refreshAsync()`](#appleauthenticationrefreshasyncoptions).\n * You must include the ID string of the user whose credentials you'd like to refresh.\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationopenidrequest)\n * for more details.\n */\nexport type AppleAuthenticationRefreshOptions = {\n user: string;\n\n /**\n * Array of user information scopes to which your app is requesting access. Note that the user can\n * choose to deny your app access to any scope at the time of logging in. You will still need to\n * handle `null` values for any scopes you request. Additionally, note that the requested scopes\n * will only be provided to you the first time each user signs into your app; in subsequent\n * requests they will be `null`. Defaults to `[]` (no scopes).\n */\n requestedScopes?: AppleAuthenticationScope[];\n\n /**\n * An arbitrary string that is returned unmodified in the corresponding credential after a\n * successful authentication. This can be used to verify that the response was from the request\n * you made and avoid replay attacks. More information on this property is available in the\n * OAuth 2.0 protocol [RFC6749](https://tools.ietf.org/html/rfc6749#section-10.12).\n */\n state?: string;\n};\n\n// @needsAudit\n/**\n * The options you can supply when making a call to [`AppleAuthentication.signOutAsync()`](#appleauthenticationsignoutasyncoptions).\n * You must include the ID string of the user to sign out.\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationopenidrequest)\n * for more details.\n */\nexport type AppleAuthenticationSignOutOptions = {\n user: string;\n\n /**\n * An arbitrary string that is returned unmodified in the corresponding credential after a\n * successful authentication. This can be used to verify that the response was from the request\n * you made and avoid replay attacks. More information on this property is available in the\n * OAuth 2.0 protocol [RFC6749](https://tools.ietf.org/html/rfc6749#section-10.12).\n */\n state?: string;\n};\n\n// @needsAudit\n/**\n * The object type returned from a successful call to [`AppleAuthentication.signInAsync()`](#appleauthenticationsigninasyncoptions),\n * [`AppleAuthentication.refreshAsync()`](#appleauthenticationrefreshasyncoptions), or [`AppleAuthentication.signOutAsync()`](#appleauthenticationsignoutasyncoptions)\n * which contains all of the pertinent user and credential information.\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationappleidcredential)\n * for more details.\n */\nexport type AppleAuthenticationCredential = {\n /**\n * An identifier associated with the authenticated user. You can use this to check if the user is\n * still authenticated later. This is stable and can be shared across apps released under the same\n * development team. The same user will have a different identifier for apps released by other\n * developers.\n */\n user: string;\n\n /**\n * An arbitrary string that your app provided as `state` in the request that generated the\n * credential. Used to verify that the response was from the request you made. Can be used to\n * avoid replay attacks. If you did not provide `state` when making the sign-in request, this field\n * will be `null`.\n */\n state: string | null;\n\n /**\n * The user's name. May be `null` or contain `null` values if you didn't request the `FULL_NAME`\n * scope, if the user denied access, or if this is not the first time the user has signed into\n * your app.\n */\n fullName: AppleAuthenticationFullName | null;\n\n /**\n * The user's email address. Might not be present if you didn't request the `EMAIL` scope. May\n * also be null if this is not the first time the user has signed into your app. If the user chose\n * to withhold their email address, this field will instead contain an obscured email address with\n * an Apple domain.\n */\n email: string | null;\n\n /**\n * A value that indicates whether the user appears to the system to be a real person.\n */\n realUserStatus: AppleAuthenticationUserDetectionStatus;\n\n /**\n * A JSON Web Token (JWT) that securely communicates information about the user to your app.\n */\n identityToken: string | null;\n\n /**\n * A short-lived session token used by your app for proof of authorization when interacting with\n * the app's server counterpart. Unlike `user`, this is ephemeral and will change each session.\n */\n authorizationCode: string | null;\n};\n\n// @needsAudit @docsMissing\n/**\n * An object representing the tokenized portions of the user's full name. Any of all of the fields\n * may be `null`. Only applicable fields that the user has allowed your app to access will be nonnull.\n */\nexport type AppleAuthenticationFullName = {\n namePrefix: string | null;\n givenName: string | null;\n middleName: string | null;\n familyName: string | null;\n nameSuffix: string | null;\n nickname: string | null;\n};\n\n// @needsAudit @docsMissing\n/**\n * An enum whose values specify scopes you can request when calling [`AppleAuthentication.signInAsync()`](#appleauthenticationsigninasyncoptions).\n *\n * > Note that it is possible that you will not be granted all of the scopes which you request.\n * > You will still need to handle null values for any fields you request.\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationscope)\n * for more details.\n */\nexport enum AppleAuthenticationScope {\n FULL_NAME = 0,\n EMAIL = 1,\n}\n\n// @needsAudit @docsMissing\nexport enum AppleAuthenticationOperation {\n /**\n * An operation that depends on the particular kind of credential provider.\n */\n IMPLICIT = 0,\n LOGIN = 1,\n REFRESH = 2,\n LOGOUT = 3,\n}\n\n// @needsAudit @docsMissing\n/**\n * An enum whose values specify state of the credential when checked with [`AppleAuthentication.getCredentialStateAsync()`](#appleauthenticationgetcredentialstateasyncuser).\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationappleidprovidercredentialstate)\n * for more details.\n */\nexport enum AppleAuthenticationCredentialState {\n REVOKED = 0,\n AUTHORIZED = 1,\n NOT_FOUND = 2,\n TRANSFERRED = 3,\n}\n\n// @needsAudit\n/**\n * An enum whose values specify the system's best guess for how likely the current user is a real person.\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asuserdetectionstatus)\n * for more details.\n */\nexport enum AppleAuthenticationUserDetectionStatus {\n /**\n * The system does not support this determination and there is no data.\n */\n UNSUPPORTED = 0,\n /**\n * The system has not determined whether the user might be a real person.\n */\n UNKNOWN = 1,\n /**\n * The user appears to be a real person.\n */\n LIKELY_REAL = 2,\n}\n\n// @needsAudit\n/**\n * An enum whose values control which pre-defined text to use when rendering an [`AppleAuthenticationButton`](#appleauthenticationappleauthenticationbutton).\n */\nexport enum AppleAuthenticationButtonType {\n /**\n * \"Sign in with Apple\"\n */\n SIGN_IN = 0,\n /**\n * \"Continue with Apple\"\n */\n CONTINUE = 1,\n /**\n * \"Sign up with Apple\" *(requires iOS 13.2 or higher)*\n */\n SIGN_UP = 2,\n}\n\n// @needsAudit\n/**\n * An enum whose values control which pre-defined color scheme to use when rendering an [`AppleAuthenticationButton`](#appleauthenticationappleauthenticationbutton).\n */\nexport enum AppleAuthenticationButtonStyle {\n /**\n * White button with black text.\n */\n WHITE = 0,\n /**\n * White button with a black outline and black text.\n */\n WHITE_OUTLINE = 1,\n /**\n * Black button with white text.\n */\n BLACK = 2,\n}\n"]}
1
+ {"version":3,"file":"AppleAuthentication.types.js","sourceRoot":"","sources":["../src/AppleAuthentication.types.ts"],"names":[],"mappings":"AA2LA,2BAA2B;AAC3B;;;;;;;;;GASG;AACH,MAAM,CAAN,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,iFAAa,CAAA;IACb,yEAAS,CAAA;AACX,CAAC,EAHW,wBAAwB,KAAxB,wBAAwB,QAGnC;AAED,2BAA2B;AAC3B,MAAM,CAAN,IAAY,4BAQX;AARD,WAAY,4BAA4B;IACtC;;OAEG;IACH,uFAAY,CAAA;IACZ,iFAAS,CAAA;IACT,qFAAW,CAAA;IACX,mFAAU,CAAA;AACZ,CAAC,EARW,4BAA4B,KAA5B,4BAA4B,QAQvC;AAED,2BAA2B;AAC3B;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,kCAKX;AALD,WAAY,kCAAkC;IAC5C,iGAAW,CAAA;IACX,uGAAc,CAAA;IACd,qGAAa,CAAA;IACb,yGAAe,CAAA;AACjB,CAAC,EALW,kCAAkC,KAAlC,kCAAkC,QAK7C;AAED,cAAc;AACd;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,sCAaX;AAbD,WAAY,sCAAsC;IAChD;;OAEG;IACH,iHAAe,CAAA;IACf;;OAEG;IACH,yGAAW,CAAA;IACX;;OAEG;IACH,iHAAe,CAAA;AACjB,CAAC,EAbW,sCAAsC,KAAtC,sCAAsC,QAajD;AAED,cAAc;AACd;;GAEG;AACH,MAAM,CAAN,IAAY,6BAcX;AAdD,WAAY,6BAA6B;IACvC;;OAEG;IACH,uFAAW,CAAA;IACX;;OAEG;IACH,yFAAY,CAAA;IACZ;;;OAGG;IACH,uFAAW,CAAA;AACb,CAAC,EAdW,6BAA6B,KAA7B,6BAA6B,QAcxC;AAED,cAAc;AACd;;GAEG;AACH,MAAM,CAAN,IAAY,8BAaX;AAbD,WAAY,8BAA8B;IACxC;;OAEG;IACH,qFAAS,CAAA;IACT;;OAEG;IACH,qGAAiB,CAAA;IACjB;;OAEG;IACH,qFAAS,CAAA;AACX,CAAC,EAbW,8BAA8B,KAA9B,8BAA8B,QAazC","sourcesContent":["import { StyleProp, ViewStyle, ViewProps } from 'react-native';\n\n// @needsAudit\nexport declare type AppleAuthenticationButtonProps = ViewProps & {\n /**\n * The method to call when the user presses the button. You should call [`AppleAuthentication.signInAsync`](#isavailableasync)\n * in here.\n */\n onPress: () => void;\n /**\n * The type of button text to display (\"Sign In with Apple\" vs. \"Continue with Apple\").\n */\n buttonType: AppleAuthenticationButtonType;\n /**\n * The Apple-defined color scheme to use to display the button.\n */\n buttonStyle: AppleAuthenticationButtonStyle;\n /**\n * The border radius to use when rendering the button. This works similarly to\n * `style.borderRadius` in other Views.\n */\n cornerRadius?: number;\n /**\n * The custom style to apply to the button. Should not include `backgroundColor` or `borderRadius`\n * properties.\n */\n style?: StyleProp<Omit<ViewStyle, 'backgroundColor' | 'borderRadius'>>;\n};\n\n// @needsAudit\n/**\n * The options you can supply when making a call to [`AppleAuthentication.signInAsync()`](#appleauthenticationsigninasyncoptions).\n * None of these options are required.\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationopenidrequest)\n * for more details.\n */\nexport type AppleAuthenticationSignInOptions = {\n /**\n * Array of user information scopes to which your app is requesting access. Note that the user can\n * choose to deny your app access to any scope at the time of logging in. You will still need to\n * handle `null` values for any scopes you request. Additionally, note that the requested scopes\n * will only be provided to you the first time each user signs into your app; in subsequent\n * requests they will be `null`. Defaults to `[]` (no scopes).\n */\n requestedScopes?: AppleAuthenticationScope[];\n\n /**\n * An arbitrary string that is returned unmodified in the corresponding credential after a\n * successful authentication. This can be used to verify that the response was from the request\n * you made and avoid replay attacks. More information on this property is available in the\n * OAuth 2.0 protocol [RFC6749](https://tools.ietf.org/html/rfc6749#section-10.12).\n */\n state?: string;\n\n /**\n * An arbitrary string that is used to prevent replay attacks. See more information on this in the\n * [OpenID Connect specification](https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowSteps).\n */\n nonce?: string;\n};\n\n// @needsAudit @docsMissing\n/**\n * The options you can supply when making a call to [`AppleAuthentication.refreshAsync()`](#appleauthenticationrefreshasyncoptions).\n * You must include the ID string of the user whose credentials you'd like to refresh.\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationopenidrequest)\n * for more details.\n */\nexport type AppleAuthenticationRefreshOptions = {\n user: string;\n\n /**\n * Array of user information scopes to which your app is requesting access. Note that the user can\n * choose to deny your app access to any scope at the time of logging in. You will still need to\n * handle `null` values for any scopes you request. Additionally, note that the requested scopes\n * will only be provided to you the first time each user signs into your app; in subsequent\n * requests they will be `null`. Defaults to `[]` (no scopes).\n */\n requestedScopes?: AppleAuthenticationScope[];\n\n /**\n * An arbitrary string that is returned unmodified in the corresponding credential after a\n * successful authentication. This can be used to verify that the response was from the request\n * you made and avoid replay attacks. More information on this property is available in the\n * OAuth 2.0 protocol [RFC6749](https://tools.ietf.org/html/rfc6749#section-10.12).\n */\n state?: string;\n};\n\n// @needsAudit\n/**\n * The options you can supply when making a call to [`AppleAuthentication.signOutAsync()`](#appleauthenticationsignoutasyncoptions).\n * You must include the ID string of the user to sign out.\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationopenidrequest)\n * for more details.\n */\nexport type AppleAuthenticationSignOutOptions = {\n user: string;\n\n /**\n * An arbitrary string that is returned unmodified in the corresponding credential after a\n * successful authentication. This can be used to verify that the response was from the request\n * you made and avoid replay attacks. More information on this property is available in the\n * OAuth 2.0 protocol [RFC6749](https://tools.ietf.org/html/rfc6749#section-10.12).\n */\n state?: string;\n};\n\n// @needsAudit\n/**\n * The object type returned from a successful call to [`AppleAuthentication.signInAsync()`](#appleauthenticationsigninasyncoptions),\n * [`AppleAuthentication.refreshAsync()`](#appleauthenticationrefreshasyncoptions), or [`AppleAuthentication.signOutAsync()`](#appleauthenticationsignoutasyncoptions)\n * which contains all of the pertinent user and credential information.\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationappleidcredential)\n * for more details.\n */\nexport type AppleAuthenticationCredential = {\n /**\n * An identifier associated with the authenticated user. You can use this to check if the user is\n * still authenticated later. This is stable and can be shared across apps released under the same\n * development team. The same user will have a different identifier for apps released by other\n * developers.\n */\n user: string;\n\n /**\n * An arbitrary string that your app provided as `state` in the request that generated the\n * credential. Used to verify that the response was from the request you made. Can be used to\n * avoid replay attacks. If you did not provide `state` when making the sign-in request, this field\n * will be `null`.\n */\n state: string | null;\n\n /**\n * The user's name. May be `null` or contain `null` values if you didn't request the `FULL_NAME`\n * scope, if the user denied access, or if this is not the first time the user has signed into\n * your app.\n */\n fullName: AppleAuthenticationFullName | null;\n\n /**\n * The user's email address. Might not be present if you didn't request the `EMAIL` scope. May\n * also be null if this is not the first time the user has signed into your app. If the user chose\n * to withhold their email address, this field will instead contain an obscured email address with\n * an Apple domain.\n */\n email: string | null;\n\n /**\n * A value that indicates whether the user appears to the system to be a real person.\n */\n realUserStatus: AppleAuthenticationUserDetectionStatus;\n\n /**\n * A JSON Web Token (JWT) that securely communicates information about the user to your app.\n */\n identityToken: string | null;\n\n /**\n * A short-lived session token used by your app for proof of authorization when interacting with\n * the app's server counterpart. Unlike `user`, this is ephemeral and will change each session.\n */\n authorizationCode: string | null;\n};\n\n// @needsAudit @docsMissing\n/**\n * An object representing the tokenized portions of the user's full name. Any of all of the fields\n * may be `null`. Only applicable fields that the user has allowed your app to access will be nonnull.\n */\nexport type AppleAuthenticationFullName = {\n namePrefix: string | null;\n givenName: string | null;\n middleName: string | null;\n familyName: string | null;\n nameSuffix: string | null;\n nickname: string | null;\n};\n\n// @needsAudit @docsMissing\n/**\n * An enum whose values specify scopes you can request when calling [`AppleAuthentication.signInAsync()`](#appleauthenticationsigninasyncoptions).\n *\n * > Note that it is possible that you will not be granted all of the scopes which you request.\n * > You will still need to handle null values for any fields you request.\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationscope)\n * for more details.\n */\nexport enum AppleAuthenticationScope {\n FULL_NAME = 0,\n EMAIL = 1,\n}\n\n// @needsAudit @docsMissing\nexport enum AppleAuthenticationOperation {\n /**\n * An operation that depends on the particular kind of credential provider.\n */\n IMPLICIT = 0,\n LOGIN = 1,\n REFRESH = 2,\n LOGOUT = 3,\n}\n\n// @needsAudit @docsMissing\n/**\n * An enum whose values specify state of the credential when checked with [`AppleAuthentication.getCredentialStateAsync()`](#appleauthenticationgetcredentialstateasyncuser).\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationappleidprovidercredentialstate)\n * for more details.\n */\nexport enum AppleAuthenticationCredentialState {\n REVOKED = 0,\n AUTHORIZED = 1,\n NOT_FOUND = 2,\n TRANSFERRED = 3,\n}\n\n// @needsAudit\n/**\n * An enum whose values specify the system's best guess for how likely the current user is a real person.\n *\n * @see [Apple\n * Documentation](https://developer.apple.com/documentation/authenticationservices/asuserdetectionstatus)\n * for more details.\n */\nexport enum AppleAuthenticationUserDetectionStatus {\n /**\n * The system does not support this determination and there is no data.\n */\n UNSUPPORTED = 0,\n /**\n * The system has not determined whether the user might be a real person.\n */\n UNKNOWN = 1,\n /**\n * The user appears to be a real person.\n */\n LIKELY_REAL = 2,\n}\n\n// @needsAudit\n/**\n * An enum whose values control which pre-defined text to use when rendering an [`AppleAuthenticationButton`](#appleauthenticationappleauthenticationbutton).\n */\nexport enum AppleAuthenticationButtonType {\n /**\n * \"Sign in with Apple\"\n */\n SIGN_IN = 0,\n /**\n * \"Continue with Apple\"\n */\n CONTINUE = 1,\n /**\n * \"Sign up with Apple\"\n * @platform ios 13.2+\n */\n SIGN_UP = 2,\n}\n\n// @needsAudit\n/**\n * An enum whose values control which pre-defined color scheme to use when rendering an [`AppleAuthenticationButton`](#appleauthenticationappleauthenticationbutton).\n */\nexport enum AppleAuthenticationButtonStyle {\n /**\n * White button with black text.\n */\n WHITE = 0,\n /**\n * White button with a black outline and black text.\n */\n WHITE_OUTLINE = 1,\n /**\n * Black button with white text.\n */\n BLACK = 2,\n}\n"]}
@@ -25,3 +25,4 @@ import { AppleAuthenticationButtonProps } from './AppleAuthentication.types';
25
25
  */
26
26
  declare const AppleAuthenticationButton: React.FC<AppleAuthenticationButtonProps>;
27
27
  export default AppleAuthenticationButton;
28
+ //# sourceMappingURL=AppleAuthenticationButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppleAuthenticationButton.d.ts","sourceRoot":"","sources":["../src/AppleAuthenticationButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,8BAA8B,EAG/B,MAAM,6BAA6B,CAAC;AAcrC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CAgBvE,CAAC;AA0BF,eAAe,yBAAyB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  declare const _default: import("expo-modules-core").ProxyNativeModule;
2
2
  export default _default;
3
+ //# sourceMappingURL=ExpoAppleAuthentication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoAppleAuthentication.d.ts","sourceRoot":"","sources":["../src/ExpoAppleAuthentication.ts"],"names":[],"mappings":";AAGA,wBAsBqB"}
@@ -1,8 +1,23 @@
1
1
  import { NativeModulesProxy } from 'expo-modules-core';
2
2
  export default NativeModulesProxy.ExpoAppleAuthentication ||
3
+ // If the real native module doesn't exist, make a pretend one, instead of
4
+ // `null`, so we can offer an `isAvailableAsync` (that will always give
5
+ // `false`, because we're on an unsupported platform).
3
6
  {
4
7
  isAvailableAsync() {
5
8
  return Promise.resolve(false);
6
9
  },
10
+ // RN v0.65 gives a console warning if this method is missing; see
11
+ // https://github.com/facebook/react-native/commit/114be1d21
12
+ addListener() {
13
+ // Nothing to do; unsupported platform.
14
+ return Promise.resolve();
15
+ },
16
+ // RN v0.65 gives a console warning if this method is missing; see
17
+ // https://github.com/facebook/react-native/commit/114be1d21
18
+ removeListeners() {
19
+ // Nothing to do; unsupported platform.
20
+ return Promise.resolve();
21
+ },
7
22
  };
8
23
  //# sourceMappingURL=ExpoAppleAuthentication.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoAppleAuthentication.js","sourceRoot":"","sources":["../src/ExpoAppleAuthentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,eAAe,kBAAkB,CAAC,uBAAuB;IACtD;QACC,gBAAgB;YACd,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;KACM,CAAC","sourcesContent":["import { NativeModulesProxy } from 'expo-modules-core';\n\nexport default NativeModulesProxy.ExpoAppleAuthentication ||\n ({\n isAvailableAsync(): Promise<boolean> {\n return Promise.resolve(false);\n },\n } as any);\n"]}
1
+ {"version":3,"file":"ExpoAppleAuthentication.js","sourceRoot":"","sources":["../src/ExpoAppleAuthentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD,eAAe,kBAAkB,CAAC,uBAAuB;IACvD,0EAA0E;IAC1E,uEAAuE;IACvE,sDAAsD;IACrD;QACC,gBAAgB;YACd,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QAED,kEAAkE;QAClE,8DAA8D;QAC9D,WAAW;YACT,uCAAuC;YACvC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QAED,kEAAkE;QAClE,8DAA8D;QAC9D,eAAe;YACb,uCAAuC;YACvC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;KACe,CAAC","sourcesContent":["import { NativeModulesProxy } from 'expo-modules-core';\nimport { NativeModule } from 'react-native';\n\nexport default NativeModulesProxy.ExpoAppleAuthentication ||\n // If the real native module doesn't exist, make a pretend one, instead of\n // `null`, so we can offer an `isAvailableAsync` (that will always give\n // `false`, because we're on an unsupported platform).\n ({\n isAvailableAsync(): Promise<boolean> {\n return Promise.resolve(false);\n },\n\n // RN v0.65 gives a console warning if this method is missing; see\n // https://github.com/facebook/react-native/commit/114be1d21\n addListener() {\n // Nothing to do; unsupported platform.\n return Promise.resolve();\n },\n\n // RN v0.65 gives a console warning if this method is missing; see\n // https://github.com/facebook/react-native/commit/114be1d21\n removeListeners() {\n // Nothing to do; unsupported platform.\n return Promise.resolve();\n },\n } as NativeModule);\n"]}
@@ -8,3 +8,4 @@ declare let ExpoAppleAuthenticationButtonSignUpWhite: any;
8
8
  declare let ExpoAppleAuthenticationButtonSignUpWhiteOutline: any;
9
9
  declare let ExpoAppleAuthenticationButtonSignUpBlack: any;
10
10
  export { ExpoAppleAuthenticationButtonSignInWhite, ExpoAppleAuthenticationButtonSignInWhiteOutline, ExpoAppleAuthenticationButtonSignInBlack, ExpoAppleAuthenticationButtonContinueWhite, ExpoAppleAuthenticationButtonContinueWhiteOutline, ExpoAppleAuthenticationButtonContinueBlack, ExpoAppleAuthenticationButtonSignUpWhite, ExpoAppleAuthenticationButtonSignUpWhiteOutline, ExpoAppleAuthenticationButtonSignUpBlack, };
11
+ //# sourceMappingURL=ExpoAppleAuthenticationButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoAppleAuthenticationButton.d.ts","sourceRoot":"","sources":["../src/ExpoAppleAuthenticationButton.ts"],"names":[],"mappings":"AAGA,QAAA,IAAI,wCAAwC,EAAE,GAAG,CAAC;AAClD,QAAA,IAAI,+CAA+C,EAAE,GAAG,CAAC;AACzD,QAAA,IAAI,wCAAwC,EAAE,GAAG,CAAC;AAClD,QAAA,IAAI,0CAA0C,EAAE,GAAG,CAAC;AACpD,QAAA,IAAI,iDAAiD,EAAE,GAAG,CAAC;AAC3D,QAAA,IAAI,0CAA0C,EAAE,GAAG,CAAC;AACpD,QAAA,IAAI,wCAAwC,EAAE,GAAG,CAAC;AAClD,QAAA,IAAI,+CAA+C,EAAE,GAAG,CAAC;AACzD,QAAA,IAAI,wCAAwC,EAAE,GAAG,CAAC;AAgClD,OAAO,EACL,wCAAwC,EACxC,+CAA+C,EAC/C,wCAAwC,EACxC,0CAA0C,EAC1C,iDAAiD,EACjD,0CAA0C,EAC1C,wCAAwC,EACxC,+CAA+C,EAC/C,wCAAwC,GACzC,CAAC"}
package/build/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './AppleAuthentication';
2
2
  export * from './AppleAuthentication.types';
3
3
  export { default as AppleAuthenticationButton } from './AppleAuthenticationButton';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-apple-authentication",
3
- "version": "4.1.0",
3
+ "version": "4.3.0",
4
4
  "description": "A unimodule that provides SignIn With Apple",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -32,7 +32,7 @@
32
32
  "license": "MIT",
33
33
  "homepage": "https://docs.expo.dev/versions/latest/sdk/apple-authentication/",
34
34
  "dependencies": {
35
- "@expo/config-plugins": "^4.0.2"
35
+ "@expo/config-plugins": "~5.0.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "expo-module-scripts": "^2.0.0"
@@ -40,5 +40,5 @@
40
40
  "peerDependencies": {
41
41
  "expo": "*"
42
42
  },
43
- "gitHead": "2e5c6983b86d5ecfca028ba64002897d8adc2cc4"
43
+ "gitHead": "093d340c3fd67ff4375af3a471c7d044aee893c9"
44
44
  }
@@ -62,7 +62,16 @@ export async function signInAsync(
62
62
  return credential;
63
63
  }
64
64
 
65
- // @docsMissing
65
+ // @needsAudit
66
+ /**
67
+ * An operation that refreshes the logged-in user’s credentials.
68
+ * Calling this method will show the sign in modal before actually refreshing the user credentials.
69
+ *
70
+ * @param options An [`AppleAuthenticationRefreshOptions`](#appleauthenticationrefreshoptions) object
71
+ * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)
72
+ * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the
73
+ * refresh operation.
74
+ */
66
75
  export async function refreshAsync(
67
76
  options: AppleAuthenticationRefreshOptions
68
77
  ): Promise<AppleAuthenticationCredential> {
@@ -83,7 +92,20 @@ export async function refreshAsync(
83
92
  return credential;
84
93
  }
85
94
 
86
- // @docsMissing
95
+ // @needsAudit
96
+ /**
97
+ * An operation that ends the authenticated session.
98
+ * Calling this method will show the sign in modal before actually signing the user out.
99
+ *
100
+ * It is not recommended to use this method to sign out the user as it works counterintuitively.
101
+ * Instead of using this method it is recommended to simply clear all the user's data collected
102
+ * from using [`signInAsync`](./#signinasync) or [`refreshAsync`](./#refreshasync) methods.
103
+ *
104
+ * @param options An [`AppleAuthenticationSignOutOptions`](#appleauthenticationsignoutoptions) object
105
+ * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)
106
+ * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the
107
+ * sign-out operation.
108
+ */
87
109
  export async function signOutAsync(
88
110
  options: AppleAuthenticationSignOutOptions
89
111
  ): Promise<AppleAuthenticationCredential> {
@@ -264,7 +264,8 @@ export enum AppleAuthenticationButtonType {
264
264
  */
265
265
  CONTINUE = 1,
266
266
  /**
267
- * "Sign up with Apple" *(requires iOS 13.2 or higher)*
267
+ * "Sign up with Apple"
268
+ * @platform ios 13.2+
268
269
  */
269
270
  SIGN_UP = 2,
270
271
  }
@@ -1,8 +1,26 @@
1
1
  import { NativeModulesProxy } from 'expo-modules-core';
2
+ import { NativeModule } from 'react-native';
2
3
 
3
4
  export default NativeModulesProxy.ExpoAppleAuthentication ||
5
+ // If the real native module doesn't exist, make a pretend one, instead of
6
+ // `null`, so we can offer an `isAvailableAsync` (that will always give
7
+ // `false`, because we're on an unsupported platform).
4
8
  ({
5
9
  isAvailableAsync(): Promise<boolean> {
6
10
  return Promise.resolve(false);
7
11
  },
8
- } as any);
12
+
13
+ // RN v0.65 gives a console warning if this method is missing; see
14
+ // https://github.com/facebook/react-native/commit/114be1d21
15
+ addListener() {
16
+ // Nothing to do; unsupported platform.
17
+ return Promise.resolve();
18
+ },
19
+
20
+ // RN v0.65 gives a console warning if this method is missing; see
21
+ // https://github.com/facebook/react-native/commit/114be1d21
22
+ removeListeners() {
23
+ // Nothing to do; unsupported platform.
24
+ return Promise.resolve();
25
+ },
26
+ } as NativeModule);
package/tsconfig.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "outDir": "./build"
6
6
  },
7
7
  "include": ["./src"],
8
- "exclude": ["**/__mocks__/*", "**/__tests__/*"]
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*", "**/__stories__/*"]
9
9
  }