// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`APISection expo-apple-authentication 1`] = `
AppleAuthenticationButton
Type:
React.Element
<
AppleAuthenticationButtonProps
>
This component displays the proprietary "Sign In with Apple" / "Continue with Apple" button on your screen. The App Store Guidelines require you to use this component to start the authentication process instead of a custom button. Limited customization of the button is available via the provided properties.
You should only attempt to render this if
AppleAuthentication.isAvailableAsync()
resolves to
true
. This component will render nothing if it is not available, and you will get
a warning in development mode (
__DEV__ === true
).
The properties of this component extend from
View
; however, you should not attempt to set
backgroundColor
or
borderRadius
with the
style
property. This will not work and is against
the App Store Guidelines. Instead, you should use the
buttonStyle
property to choose one of the
predefined color styles and the
cornerRadius
property to change the border radius of the
button.
Make sure to attach height and width via the style props as without these styles, the button will not appear on the screen.
See: Apple Documentation for more details.
buttonStyle
Type:
AppleAuthenticationButtonStyle
The Apple-defined color scheme to use to display the button.
buttonType
Type:
AppleAuthenticationButtonType
The type of button text to display ("Sign In with Apple" vs. "Continue with Apple").
cornerRadius
Optional •
Type:
number
The border radius to use when rendering the button. This works similarly to
style.borderRadius
in other Views.
onPress
Type:
(
) =>
void
The method to call when the user presses the button. You should call
AppleAuthentication.signInAsync
in here.
style
Optional •
Type:
StyleProp
<
Omit
<
ViewStyle
,
'backgroundColor'
|
'borderRadius'
>
>
The custom style to apply to the button. Should not include
backgroundColor
or
borderRadius
properties.
getCredentialStateAsync(user)
| Name | Type | Description |
|---|---|---|
| user |
string
|
The unique identifier for the user whose credential state you'd like to check.
This should come from the user field of an
|
Queries the current state of a user credential, to determine if it is still valid or if it has been revoked.
Note: This method must be tested on a real device. On the iOS simulator it always throws an error.
Returns
A promise that fulfills with an
AppleAuthenticationCredentialState
value depending on the state of the credential.
isAvailableAsync()
Determine if the current device's operating system supports Apple authentication.
Returns
Promise
<
boolean
>
A promise that fulfills with
true
if the system supports Apple authentication, and
false
otherwise.
refreshAsync(options)
| Name | Type | Description |
|---|---|---|
| options |
AppleAuthenticationRefreshOptions
|
An
|
An operation that refreshes the logged-in user’s credentials. Calling this method will show the sign in modal before actually refreshing the user credentials.
Returns
A promise that fulfills with an
AppleAuthenticationCredential
object after a successful authentication, and rejects with
ERR_REQUEST_CANCELED
if the user cancels the
refresh operation.
signInAsync(options)
| Name | Type | Description |
|---|---|---|
|
options
(optional) |
AppleAuthenticationSignInOptions
|
An optional
|
Sends a request to the operating system to initiate the Apple authentication flow, which will present a modal to the user over your app and allow them to sign in.
You can request access to the user's full name and email address in this method, which allows you to personalize your UI for signed in users. However, users can deny access to either or both of these options at runtime.
Additionally, you will only receive Apple Authentication Credentials the first time users sign
into your app, so you must store it for later use. It's best to store this information either
server-side, or using
SecureStore
, so that the data persists across app installs.
You can use
AppleAuthenticationCredential.user
to identify
the user, since this remains the same for apps released by the same developer.
Returns
A promise that fulfills with an
AppleAuthenticationCredential
object after a successful authentication, and rejects with
ERR_REQUEST_CANCELED
if the user cancels the
sign-in operation.
signOutAsync(options)
| Name | Type | Description |
|---|---|---|
| options |
AppleAuthenticationSignOutOptions
|
An
|
An operation that ends the authenticated session. Calling this method will show the sign in modal before actually signing the user out.
It is not recommended to use this method to sign out the user as it works counterintuitively.
Instead of using this method it is recommended to simply clear all the user's data collected
from using
signInAsync
or
refreshAsync
methods.
Returns
A promise that fulfills with an
AppleAuthenticationCredential
object after a successful authentication, and rejects with
ERR_REQUEST_CANCELED
if the user cancels the
sign-out operation.
AppleAuthenticationCredential
The object type returned from a successful call to
AppleAuthentication.signInAsync()
,
AppleAuthentication.refreshAsync()
, or
AppleAuthentication.signOutAsync()
which contains all of the pertinent user and credential information.
See: Apple Documentation for more details.
| Name | Type | Description |
|---|---|---|
| authorizationCode |
string
|
null
|
A short-lived session token used by your app for proof of authorization when interacting with
the app's server counterpart. Unlike
|
string
|
null
|
The user's email address. Might not be present if you didn't request the
|
|
| fullName |
AppleAuthenticationFullName
|
null
|
The user's name. May be
|
| identityToken |
string
|
null
|
A JSON Web Token (JWT) that securely communicates information about the user to your app. |
| realUserStatus |
AppleAuthenticationUserDetectionStatus
|
A value that indicates whether the user appears to the system to be a real person. |
| state |
string
|
null
|
An arbitrary string that your app provided as
|
| user |
string
|
An identifier associated with the authenticated user. You can use this to check if the user is still authenticated later. This is stable and can be shared across apps released under the same development team. The same user will have a different identifier for apps released by other developers. |
AppleAuthenticationFullName
An object representing the tokenized portions of the user's full name. Any of all of the fields
may be
null
. Only applicable fields that the user has allowed your app to access will be nonnull.
| Name | Type | Description |
|---|---|---|
| familyName |
string
|
null
|
- |
| givenName |
string
|
null
|
- |
| middleName |
string
|
null
|
- |
| namePrefix |
string
|
null
|
- |
| nameSuffix |
string
|
null
|
- |
| nickname |
string
|
null
|
- |
AppleAuthenticationRefreshOptions
The options you can supply when making a call to
AppleAuthentication.refreshAsync()
.
You must include the ID string of the user whose credentials you'd like to refresh.
See: Apple Documentation for more details.
| Name | Type | Description |
|---|---|---|
|
requestedScopes
(optional) |
AppleAuthenticationScope
[]
|
Array of user information scopes to which your app is requesting access. Note that the user can
choose to deny your app access to any scope at the time of logging in. You will still need to
handle
|
|
state
(optional) |
string
|
An arbitrary string that is returned unmodified in the corresponding credential after a successful authentication. This can be used to verify that the response was from the request you made and avoid replay attacks. More information on this property is available in the OAuth 2.0 protocol RFC6749 . |
| user |
string
|
- |
AppleAuthenticationSignInOptions
The options you can supply when making a call to
AppleAuthentication.signInAsync()
.
None of these options are required.
See: Apple Documentation for more details.
| Name | Type | Description |
|---|---|---|
|
nonce
(optional) |
string
|
An arbitrary string that is used to prevent replay attacks. See more information on this in the OpenID Connect specification . |
|
requestedScopes
(optional) |
AppleAuthenticationScope
[]
|
Array of user information scopes to which your app is requesting access. Note that the user can
choose to deny your app access to any scope at the time of logging in. You will still need to
handle
|
|
state
(optional) |
string
|
An arbitrary string that is returned unmodified in the corresponding credential after a successful authentication. This can be used to verify that the response was from the request you made and avoid replay attacks. More information on this property is available in the OAuth 2.0 protocol RFC6749 . |
AppleAuthenticationSignOutOptions
The options you can supply when making a call to
AppleAuthentication.signOutAsync()
.
You must include the ID string of the user to sign out.
See: Apple Documentation for more details.
| Name | Type | Description |
|---|---|---|
|
state
(optional) |
string
|
An arbitrary string that is returned unmodified in the corresponding credential after a successful authentication. This can be used to verify that the response was from the request you made and avoid replay attacks. More information on this property is available in the OAuth 2.0 protocol RFC6749 . |
| user |
string
|
- |
Subscription
| Name | Type | Description |
|---|---|---|
| remove |
() =>
void
|
- |
AppleAuthenticationButtonStyle
An enum whose values control which pre-defined color scheme to use when rendering an
AppleAuthenticationButton
.
WHITE_OUTLINE
AppleAuthenticationButtonStyle.WHITE_OUTLINE = 1
White button with a black outline and black text.
AppleAuthenticationButtonType
An enum whose values control which pre-defined text to use when rendering an
AppleAuthenticationButton
.
AppleAuthenticationCredentialState
An enum whose values specify state of the credential when checked with
AppleAuthentication.getCredentialStateAsync()
.
See: Apple Documentation for more details.
REVOKED
AppleAuthenticationCredentialState.REVOKED = 0
AUTHORIZED
AppleAuthenticationCredentialState.AUTHORIZED = 1
NOT_FOUND
AppleAuthenticationCredentialState.NOT_FOUND = 2
TRANSFERRED
AppleAuthenticationCredentialState.TRANSFERRED = 3
AppleAuthenticationOperation
IMPLICIT
AppleAuthenticationOperation.IMPLICIT = 0
An operation that depends on the particular kind of credential provider.
LOGIN
AppleAuthenticationOperation.LOGIN = 1
REFRESH
AppleAuthenticationOperation.REFRESH = 2
LOGOUT
AppleAuthenticationOperation.LOGOUT = 3
AppleAuthenticationScope
An enum whose values specify scopes you can request when calling
AppleAuthentication.signInAsync()
.
Note that it is possible that you will not be granted all of the scopes which you request. You will still need to handle null values for any fields you request.
See: Apple Documentation for more details.
FULL_NAME
AppleAuthenticationScope.FULL_NAME = 0
EMAIL
AppleAuthenticationScope.EMAIL = 1
AppleAuthenticationUserDetectionStatus
An enum whose values specify the system's best guess for how likely the current user is a real person.
See: Apple Documentation for more details.
UNSUPPORTED
AppleAuthenticationUserDetectionStatus.UNSUPPORTED = 0
The system does not support this determination and there is no data.
UNKNOWN
AppleAuthenticationUserDetectionStatus.UNKNOWN = 1
The system has not determined whether the user might be a real person.
LIKELY_REAL
AppleAuthenticationUserDetectionStatus.LIKELY_REAL = 2
The user appears to be a real person.
BarCodeScanner
Type:
React.
Component
<
BarCodeScannerProps
>
barCodeTypes
Optional •
Type:
string[]
An array of bar code types. Usage:
BarCodeScanner.Constants.BarCodeType.<codeType>
where
codeType
is one of these
listed above
. Defaults to all supported bar
code types. It is recommended to provide only the bar code formats you expect to scan to
minimize battery usage.
For example:
barCodeTypes={[BarCodeScanner.Constants.BarCodeType.qr]}
.
onBarCodeScanned
Optional •
Type:
BarCodeScannedCallback
A callback that is invoked when a bar code has been successfully scanned. The callback is provided with an BarCodeScannerResult .
Note: Passing
undefinedto theonBarCodeScannedprop will result in no scanning. This can be used to effectively "pause" the scanner so that it doesn't continually scan even after data has been retrieved.
type
Optional •
Type:
'front'
|
'back'
|
number
• Default:
Type.back
Camera facing. Use one of
BarCodeScanner.Constants.Type
. Use either
Type.front
or
Type.back
.
Same as
Camera.Constants.Type
.
usePermissions(options)
| Name | Type | Description |
|---|---|---|
|
options
(optional) |
PermissionHookOptions
<
object
>
|
- |
Check or request permissions for the barcode scanner.
This uses both
requestPermissionAsync
and
getPermissionsAsync
to interact with the permissions.
Example
const
[
permissionResponse
,
requestPermission
]
=
BarCodeScanner
.
usePermissions
(
)
;
Returns
[
null
|
PermissionResponse
,
RequestPermissionMethod
<
PermissionResponse
>
,
GetPermissionMethod
<
PermissionResponse
>
]
BarCodeScanner.getPermissionsAsync()
Checks user's permissions for accessing the camera.
Returns
Return a promise that fulfills to an object of type
PermissionResponse
.
BarCodeScanner.requestPermissionsAsync()
Asks the user to grant permissions for accessing the camera.
On iOS this will require apps to specify the
NSCameraUsageDescription
entry in the
Info.plist
.
Returns
Return a promise that fulfills to an object of type
PermissionResponse
.
BarCodeScanner.scanFromURLAsync(url, barCodeTypes)
| Name | Type | Description |
|---|---|---|
| url |
string
|
URL to get the image from. |
|
barCodeTypes
(optional) |
string[]
|
An array of bar code types. Defaults to all supported bar code types on the platform.
|
Scan bar codes from the image given by the URL.
Returns
A possibly empty array of objects of the
BarCodeScannerResult
shape, where the type
refers to the bar code type that was scanned and the data is the information encoded in the bar
code.
PermissionResponse
An object obtained by permissions get and request functions.
PermissionResponse Properties
| Name | Type | Description |
|---|---|---|
| canAskAgain |
boolean
|
Indicates if user can be asked again for specific permission. If not, one should be directed to the Settings app in order to enable/disable the permission. |
| expires |
PermissionExpiration
|
Determines time when the permission expires. |
| granted |
boolean
|
A convenience boolean that indicates if the permission is granted. |
| status |
PermissionStatus
|
Determines the status of the permission. |
BarCodeBounds
| Name | Type | Description |
|---|---|---|
| origin |
BarCodePoint
|
The origin point of the bounding box. |
| size |
BarCodeSize
|
The size of the bounding box. |
BarCodeEventCallbackArguments
| Name | Type | Description |
|---|---|---|
| nativeEvent |
BarCodeEvent
|
- |
BarCodePoint
Those coordinates are represented in the coordinate space of the barcode source (e.g. when you are using the barcode scanner view, these values are adjusted to the dimensions of the view).
| Name | Type | Description |
|---|---|---|
| x |
number
|
The
|
| y |
number
|
The
|
BarCodeScannedCallback
()
| Name | Type | Description |
|---|---|---|
| params |
BarCodeEvent
|
- |
BarCodeScannerResult
| Name | Type | Description |
|---|---|---|
| bounds |
BarCodeBounds
|
The
BarCodeBounds
object.
|
| cornerPoints |
BarCodePoint
[]
|
Corner points of the bounding box.
|
| data |
string
|
The information encoded in the bar code. |
| type |
string
|
The barcode type. |
BarCodeSize
| Name | Type | Description |
|---|---|---|
| height |
number
|
The height value. |
| width |
number
|
The width value. |
PermissionHookOptions
Acceptable values are:
PermissionHookBehavior
,
Options
.
PermissionStatus
UNDETERMINED
PermissionStatus.UNDETERMINED = "undetermined"
User hasn't granted or denied the permission yet.
getStepCountAsync(start, end)
| Name | Type | Description |
|---|---|---|
| start |
Date
|
A date indicating the start of the range over which to measure steps. |
| end |
Date
|
A date indicating the end of the range over which to measure steps. |
Get the step count between two dates.
Returns
Returns a promise that fulfills with a
PedometerResult
.
As Apple documentation states :
Only the past seven days worth of data is stored and available for you to retrieve. Specifying a start date that is more than seven days in the past returns only the available data.
isAvailableAsync()
Returns whether the pedometer is enabled on the device.
Returns
Promise
<
boolean
>
Returns a promise that fulfills with a
boolean
, indicating whether the pedometer is
available on this device.
watchStepCount(callback)
| Name | Type | Description |
|---|---|---|
| callback |
PedometerUpdateCallback
|
A callback that is invoked when new step count data is available. The callback is
provided with a single argument that is
|
Subscribe to pedometer updates.
Returns
Returns a
Subscription
that enables you to call
remove()
when you would like to unsubscribe the listener.
PermissionResponse
An object obtained by permissions get and request functions.
PermissionResponse Properties
| Name | Type | Description |
|---|---|---|
| canAskAgain |
boolean
|
Indicates if user can be asked again for specific permission. If not, one should be directed to the Settings app in order to enable/disable the permission. |
| expires |
PermissionExpiration
|
Determines time when the permission expires. |
| granted |
boolean
|
A convenience boolean that indicates if the permission is granted. |
| status |
PermissionStatus
|
Determines the status of the permission. |
PedometerResult
| Name | Type | Description |
|---|---|---|
| steps |
number
|
Number of steps taken between the given dates. |
PedometerUpdateCallback
()
Callback function providing event result as an argument.
| Name | Type | Description |
|---|---|---|
| result |
PedometerResult
|
- |
PermissionExpiration
Permission expiration time. Currently, all permissions are granted permanently.
Acceptable values are:
'never'
,
number
.
Subscription
| Name | Type | Description |
|---|---|---|
| remove |
() =>
void
|
- |
PermissionStatus
UNDETERMINED
PermissionStatus.UNDETERMINED = "undetermined"
User hasn't granted or denied the permission yet.
No API data file found, sorry!