Skip to content

Latest commit

 

History

History
93 lines (56 loc) · 2.48 KB

_lib_index_d_.rnappleauth.appleauthcredentialstate.md

File metadata and controls

93 lines (56 loc) · 2.48 KB

Enumeration: AppleAuthCredentialState

The current Apple Authorization state.

What is it?

This is an exported member, AppleAuthCredentialState from the react-native-apple-authentication library. This is used to check the user's current authorization state after a appleAuth.getCredentialStateForUser(user) request has been made.

import appleAuth, {
  AppleAuthRequestOperation,
  AppleAuthRequestScope,
  AppleAuthCredentialState,
} from '@invertase/react-native-apple-authentication';

async function onPressAppleButton() {
  const requestOptions = {
    requestedOperation: AppleAuthRequestOperation.LOGIN,
    requestedScopes: [AppleAuthRequestScope.EMAIL, AppleAuthRequestScope.FULL_NAME],
  };

  const { user } = await appleAuth.performRequest(requestOptions);

  const credentialState = await appleAuth.getCredentialStateForUser(user);

  if (credentialState === AppleAuthCredentialState.AUTHORIZED) {
    //user is authorized
  }

  if (credentialState === AppleAuthCredentialState.NOT_FOUND) {

  }

  if (credentialState === AppleAuthCredentialState.REVOKED) {

  }

  if (credentialState === AppleAuthCredentialState.TRANSFERRED) {
  }
}

Index

Enumeration members

Enumeration members

AUTHORIZED

AUTHORIZED:

Defined in lib/index.d.ts:83

The Opaque user ID is in good state.


NOT_FOUND

NOT_FOUND:

Defined in lib/index.d.ts:88

The Opaque user ID was not found.


REVOKED

REVOKED:

Defined in lib/index.d.ts:78

The Opaque user ID was revoked by the user.


TRANSFERRED

TRANSFERRED:

Defined in lib/index.d.ts:95

N/A

url https://developer.apple.com/documentation/authenticationservices/asauthorizationappleidprovidercredentialstate/asauthorizationappleidprovidercredentialtransferred?language=objc