TomBrouws / capacitor-apple-login

Capacitor Apple Login

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Capacitor Apple Login

npm npm

Installation

  • npm i capacitor-apple-login

OR

  • npm i https://github.com/htorbov/capacitor-apple-login

Usage (iOS)

import { Plugins } from '@capacitor/core'

const { SignInWithApple } = Plugins

SignInWithApple.Authorize().then(response => {
  console.log(response)
}).catch(response => {
  console.error(response)
})

Instructions (Android/Web)

The plugin currently works for iOS only. It's made only to pass Apple's new terms. Add the Apple button only after you've checked that the user is on iOS device. If someone wants to implement Android/Web as well - all pull requests will be well welcomed :-)

const { Device } = Plugins

let device = await Device.getInfo()

if (device.platform === 'ios') {
  // Show the button with SignInWithApple.Authorize()
}

About

Capacitor Apple Login


Languages

Language:Swift 45.1%Language:Java 21.5%Language:Ruby 11.3%Language:TypeScript 10.2%Language:Objective-C 8.6%Language:JavaScript 3.3%