0.0.4 • Published 2 years ago

capacitor-plugin-sign-in-with-apple-v3 v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

capacitor-plugin-sign-in-with-apple-v3

one sign in with apple plugin on capacitor v3

Install

npm install capacitor-plugin-sign-in-with-apple-v3
npx cap sync

USE

import { SignInWithApple } from 'capacitor-plugin-sign-in-with-apple-v3';

async applelogin() {
    const { value } = await SignInWithApple.getCanShowButton();
    console.log("applelogin ~ can show:", value)
    if (value) {
      const r = await SignInWithApple.login()
      console.log("applelogin", r);
    }
  }

API

echo(...)

echo(options: { value: string; }) => Promise<{ value: string; }>
ParamType
options{ value: string; }

Returns: Promise<{ value: string; }>


getCanShowButton()

getCanShowButton() => Promise<CanShowButton>

Returns: Promise<CanShowButton>


login()

login() => Promise<LoginResponse>

Returns: Promise<LoginResponse>


checkStateWithUserID(...)

checkStateWithUserID(options: { userId: string; }) => Promise<CheckStateResponse>
ParamType
options{ userId: string; }

Returns: Promise<CheckStateResponse>


Interfaces

CanShowButton

PropType
valueboolean

LoginResponse

PropType
"state"number
"errCode"string
"errDesc"string
"info"AppleUserInfo | null

AppleUserInfo

PropType
"state"string
"userIdentifier"string
"familyName"string
"givenName"string
"nickname"string
"middleName"string
"namePrefix"string
"nameSuffix"string
"familyName_phone"string
"givenName_phone"string
"nickname_phone"string
"namePrefix_phone"string
"nameSuffix_phone"string
"middleName_phone"string
"email"string
"identityToken"string
"authCode"string
"realUserStatus"string

CheckStateResponse

PropTypeDescription
"state"number"state":1,"errDesc": "Apple ID Credential is valid" "state":-2, "errDesc": "Credential not found, show login UI"
"errDesc"string