capacitor-community / apple-sign-in

Sign in with Apple Support
MIT License
143 stars 60 forks source link

[error] - ERROR {} in Xcode console #21

Closed marcopes closed 3 years ago

marcopes commented 3 years ago

Describe the bug I'm new to Capacitor. In my login.ts I declared a functions named "openAppleSignIn()" using this plugin. in my login.html I use this function in a button.

"[error] - ERROR {}" in Xcode console when I use "openAppleSignIn()" in Ionic app.

To Reproduce see Additional context

Screenshots

Schermata 2021-01-17 alle 22 33 32

Desktop (please complete the following information): iOS 14.3

Smartphone (please complete the following information): iPhone Xr

Additional context Here's my login.ts

import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { LoadingController, ToastController, AlertController } from '@ionic/angular'; import { Router } from '@angular/router'; import { AuthService } from '../../services/auth.service';

import { Plugins} from "@capacitor/core"; import {SignInWithApple, SignInWithAppleResponse, SignInWithAppleOptions } from "@capacitor-community/apple-sign-in";

@Component({ selector: 'app-login', templateUrl: './login.page.html', styleUrls: ['./login.page.scss'], }) export class LoginPage implements OnInit {

@ViewChild('flipcontainer', { static: false }) flipcontainer: ElementRef;

constructor(private fb: FormBuilder, private authService: AuthService, private loadingCtrl: LoadingController, private toastCtrl: ToastController, private alertCtrl: AlertController, private router: Router) {}

ngOnInit() { }

openAppleSignIn() { Plugins.SignInWithApple.authorize() .then((result: SignInWithAppleResponse) => { // Handle user information // Validate token with server and create new session console.log(result) }) .catch((error) => { // Handle error console.log(error) }); }

}

marcopes commented 3 years ago

sorry my fault, I didn't do nix cap sync. sorry new to capacitor.