Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error About Sign In With Apple In Ionic 3 #3476

Closed
kaanerdogan opened this issue Jul 1, 2020 · 7 comments
Closed

Build Error About Sign In With Apple In Ionic 3 #3476

kaanerdogan opened this issue Jul 1, 2020 · 7 comments

Comments

@kaanerdogan
Copy link

I'm submitting a ... (check one with "x")
[x] bug report

Current behavior:
Build Error after installed Sing In With Apple

ionic cordova prepare ios

typescript: node_modules/@ionic-native/sign-in-with-apple/ngx/index.d.ts, line: 6
Initializers are not allowed in ambient contexts.

   L5:  export declare class ASAuthorizationAppleIDRequest {
   L6:      static readonly ASAuthorizationScopeFullName = 0;
   L7:      static readonly ASAuthorizationScopeEmail = 1;

[12:59:29] typescript: node_modules/@ionic-native/sign-in-with-apple/ngx/index.d.ts, line: 7
Initializers are not allowed in ambient contexts.

   L6:  static readonly ASAuthorizationScopeFullName = 0;
   L7:  static readonly ASAuthorizationScopeEmail = 1;
   L8:  requestedScopes?: number[];

After commend line those lines and call plugin with

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

no error while prepare or building.
But after that the pop-up should appear for email and name doesn't show up.

Expected behavior:
Email and name pop up should appear.

Other information:
I opened issue in plugins repo but they told me to open issue to ionic natives repo because it is not relevant with ours plugin.

I tried to do exactly like here but nope. In ionic 3 there is an error.

Ionic info:

Ionic:

   Ionic CLI          : 6.10.1 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework    : ionic-angular 3.9.9
   @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 5 other plugins)

Utility:

   cordova-res : 0.15.1
   native-run  : 1.0.0

System:

   ios-deploy : 1.10.0
   ios-sim    : 8.0.2
   NodeJS     : v12.18.0 (/usr/local/bin/node)
   npm        : 6.14.5
   OS         : macOS Catalina
   Xcode      : Xcode 11.5 Build version 11E608c```
@navycoder70
Copy link

I'm submitting a ... (check one with "x")
[x] bug report

Current behavior:
Build Error after installed Sing In With Apple

ionic cordova prepare ios

typescript: node_modules/@ionic-native/sign-in-with-apple/ngx/index.d.ts, line: 6
Initializers are not allowed in ambient contexts.

   L5:  export declare class ASAuthorizationAppleIDRequest {
   L6:      static readonly ASAuthorizationScopeFullName = 0;
   L7:      static readonly ASAuthorizationScopeEmail = 1;

[12:59:29] typescript: node_modules/@ionic-native/sign-in-with-apple/ngx/index.d.ts, line: 7
Initializers are not allowed in ambient contexts.

   L6:  static readonly ASAuthorizationScopeFullName = 0;
   L7:  static readonly ASAuthorizationScopeEmail = 1;
   L8:  requestedScopes?: number[];

After commend line those lines and call plugin with

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

no error while prepare or building.
But after that the pop-up should appear for email and name doesn't show up.

Expected behavior:
Email and name pop up should appear.

Other information:
I opened issue in plugins repo but they told me to open issue to ionic natives repo because it is not relevant with ours plugin.

I tried to do exactly like here but nope. In ionic 3 there is an error.

Ionic info:

Ionic:

   Ionic CLI          : 6.10.1 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework    : ionic-angular 3.9.9
   @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 5 other plugins)

Utility:

   cordova-res : 0.15.1
   native-run  : 1.0.0

System:

   ios-deploy : 1.10.0
   ios-sim    : 8.0.2
   NodeJS     : v12.18.0 (/usr/local/bin/node)
   npm        : 6.14.5
   OS         : macOS Catalina
   Xcode      : Xcode 11.5 Build version 11E608c```

ı also have same issue pls help

@AmrAbdalrahman
Copy link

AmrAbdalrahman commented Jul 16, 2020

I tried your solution and faced the same issues with me.

my implementation for login with Apple ID works well with me ionic 3.

ionic cordova plugin add cordova-plugin-sign-in-with-apple

//before @component add declare var cordova: any;

        async loginWithAppleID() {
        await cordova.plugins.SignInWithApple.signin(
          {requestedScopes: [0, 1]},
          (succ) => {
            //get email and full name from Apple ID
            console.log(succ)
            let userData = {
              name: succ.fullName.givenName + ' ' + succ.fullName.familyName,
              email: succ.email,
            };
    // this.AuthApi;
          },
          (err) => {
            console.error(err)
            console.log(JSON.stringify(err))
          }
        )
      }

@yuber1792
Copy link

@AmrAlmagic

Hello, I solved my problem but when I execute the function I do not get anything, it works in simulator?

thanks.

@AmrAbdalrahman
Copy link

@AmrAlmagic

Hello, I solved my problem but when I execute the function I do not get anything, it works in simulator?

thanks.

yes, it works in the simulator.

@ericgopak
Copy link
Contributor

Getting the same error.
The error comes from the small changes in this commit.

Using the version before that commit solved the problem for me. If you're ok with reverting to a previous version, try this:

npm install @ionic-native/[email protected]

After that ionic build should succeed. Good luck!

@nurzarifah
Copy link

I tried your solution and faced the same issues with me.

my implementation for login with Apple ID works well with me ionic 3.

ionic cordova plugin add cordova-plugin-sign-in-with-apple

//before @component add declare var cordova: any;

        async loginWithAppleID() {
        await cordova.plugins.SignInWithApple.signin(
          {requestedScopes: [0, 1]},
          (succ) => {
            //get email and full name from Apple ID
            console.log(succ)
            let userData = {
              name: succ.fullName.givenName + ' ' + succ.fullName.familyName,
              email: succ.email,
            };
    // this.AuthApi;
          },
          (err) => {
            console.error(err)
            console.log(JSON.stringify(err))
          }
        )
      }

Hello, may I know what is the meaning of those two comments? For the first, is it we inserted by ourself or getting it from apple? It seems like getting from apple but how? And the second is this.AuthApi. May I know what is it? Thank you..

@github-actions
Copy link

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue, please create a new issue and ensure the template is fully filled out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants