capacitor-plugin-sign-in-with-apple-v3
v0.0.4
Published
one sign in with apple plugin on capacitor v3
Downloads
9
Readme
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; }>
| Param | Type |
| ------------- | ------------------------------- |
| 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>
| Param | Type |
| ------------- | -------------------------------- |
| options
| { userId: string; } |
Returns: Promise<CheckStateResponse>
Interfaces
CanShowButton
| Prop | Type |
| ----------- | -------------------- |
| value
| boolean |
LoginResponse
| Prop | Type |
| --------------- | --------------------------------------------------------------- |
| "state"
| number |
| "errCode"
| string |
| "errDesc"
| string |
| "info"
| AppleUserInfo | null |
AppleUserInfo
| Prop | Type |
| ------------------------ | ------------------- |
| "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
| Prop | Type | Description |
| --------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| "state"
| number | ["state":1,"errDesc": "Apple ID Credential is valid"] ["state":-1, "errDesc": "Apple ID Credential revoked, handle unlink"] ["state":-2, "errDesc": "Credential not found, show login UI"] ["state":-3, "errDesc": "Other"] |
| "errDesc"
| string | |