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
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";
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
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) }); }
}