twogate/cordova-plugin-sign-in-with-apple

Native popup doesn't show up with Ionic 3

Opened this issue · 3 comments

Working on ionic 3 project.

cordova -v
9.0.0 (cordova-lib@9.0.1)

First there was an error about not recognizing your code. Same as here.
After changing your code like

export declare class ASAuthorizationAppleIDRequest {
    // static readonly ASAuthorizationScopeFullName = 0;
    // static readonly ASAuthorizationScopeEmail = 1;
    requestedScopes?: number[];
}

and give requestedScopes with numbers like

...signin({requestedScopes: [0, 1]})

that error wasn't there anymore. But also nothing happening. Can not get in your plugins scope. Therefore popup doesnt show up.

keiya commented

It is the problem of @ionic-native/sign-in-with-apple, not ours.
Please consider issue the report to ionic-native's repository.

Ionics repo isn't the same with yours? Have they changed anything in code as far as you know? Both your link and ionic docs refers to this repo. I believe they didn't change anything. But i'll do it.

With Ionic 3 you can't use the Ionic wrapper as far as I know. I got the login prompt working with this code:

import ...

declare var cordova: any;  // <-- need to declare this before @Component

@Component
...

  loginApple() {
        cordova.plugins.SignInWithApple.signin({
            requestedScopes: [0, 1]
        }, (res: any) => {
            console.log('Success: ', res);
        }, (error: any) => {
            console.error('Error: ', error);
        });
  }

the issue I can't seem to figure out is that it's always showing the same prompt and there's no "quick flow" on the second try where user just presses "Continue" and doesn't have to select "Hide or show email"