0.1.6 • Published 9 months ago

@diadal/signin-with-apple v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@diadal/signin-with-apple

Sign In With Apple for Capacitor 3

Install

npm install @diadal/signin-with-apple
npx cap sync
<template>
  <div class="row items-center justify-evenly">
    <button label="Test" @click="LoginApp()" />
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { uid } from 'quasar';
import {
  SigninWithApple,
  AppleSignResponse,
  AppleSignOptions,
} from '@diadal/signin-with-apple';

export default defineComponent({
  name: 'PageIndex',
  setup() {
    const options: AppleSignOptions = {
      clientId: 'app.example',
      redirectURI: 'https://example.com/auth/apple/callback',
      scopes: 'email name',
      state: '********',
      nonce: '**********',
    };

    function LoginApp() {
      SigninWithApple.authorize(options)
        .then((result: AppleSignResponse) => {
          console.log('result111', result);
        })
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        .catch((error: any) => {
          console.log('error111', error);
        });
    }

    return { LoginApp };
  },
});
</script>

API

authorize(...)

authorize(options?: AppleSignOptions | undefined) => Promise<AppleSignResponse>
ParamType
optionsAppleSignOptions

Returns: Promise<AppleSignResponse>


Interfaces

AppleSignResponse

PropType
response{ user: string[]; email: string | null; state: string | null; id_token: string; code: string; }

AppleSignOptions

PropType
clientIdstring
redirectURIstring
scopesstring
statestring
noncestring
0.1.6

9 months ago

0.1.5

9 months ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.3

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago