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

[RESOLVED] [VUE] Error in iOS: "code":"UNIMPLEMENTED" / And in web: SignInWithApple.Authorize() is not implemented on web #58

Closed
sbellver opened this issue Sep 29, 2021 · 5 comments

Comments

@sbellver
Copy link

Describe the bug
I'm using Capacitor 3 & Quasar Framework (Vue)

To Reproduce

  1. Configure Xcode with Apple Sign In capabilities
  2. Install capacitor plugin (nom install...)
  3. Import to Vue page
    import { SignInWithApple, SignInWithAppleResponse, SignInWithAppleOptions, } from '../../../src-capacitor/node_modules/@capacitor-community/apple-sign-in';
  4. Configure options
const options = {
        clientId: 'domain.name',
        redirectURI: 'https://api.url/login',
        scopes: 'email name',
        state: '12345',
        nonce: 'nonce',
      };
  1. Add function to login
SignInWithApple.Authorize(options)
        .then(async (AppleUser) => {
          if (AppleUser.AppleUserponse && AppleUser.AppleUserponse.identityToken) {
            this.user = AppleUser.AppleUserponse;
            this.$api.post('social_login', AppleUser.AppleUserponse).then(({ data }) => {
              this.$api.defaults.headers = { common: { Authorization: `Bearer ${data.token}` } };
              this.$q.localStorage.set('token', data.token);
              this.$q.localStorage.set('user', data.user);
              this.$store.commit('user', data.user);
              this.$router.push({ name: 'home' });
            }).catch(() => {
              this.$router.push({ name: 'signup', params: AppleUser });
            });
          } else {
            this.presentAlert();
            console.log('Algo ha fallado en el Signin');
          }
        })
        .catch((response) => {
          console.log(response);
          console.log('Algo a fallado en el response');
        });

Then, when I press the button and call the loginApple() I get in Xcode debug :

⚡️  [log] - Entramos en el signin
⚡️  [log] - {"code":"UNIMPLEMENTED"}
⚡️  [log] - Algo a fallado en el response
@sbellver
Copy link
Author

With the same code, if I use it on web:

Error: "SignInWithApple.Authorize()" is not implemented on web

:'(

@sbellver sbellver changed the title "code":"UNIMPLEMENTED" [VUE] Error in iOS: "code":"UNIMPLEMENTED" / And in web: SignInWithApple.Authorize() is not implemented on web Sep 30, 2021
@nicolardi
Copy link

it's the same here!

@sbellver
Copy link
Author

This function is near to work

loginApple() {
      const options = {
        clientId: 'es.yakk.api',
        redirectURI: 'https://api.yakk.es/api/login_apple',
        scopes: 'email name',
        state: '1231232132141512421',
        nonce: 'nonce',
      };
      return SignInWithApple.authorize(options)
        .then((res) => {
          console.log(res);
          console.log('Apretamos el boton');
          return 0;
        }).catch((e) => {
          console.log(e);
          console.log('Nos vamos fuera');
        });
    },

Now, I push apple signings button and works, ask me about share email and then login.

Next step is confirm password. In this stage it hangs. No logs, simply do nothing.

@sbellver sbellver changed the title [VUE] Error in iOS: "code":"UNIMPLEMENTED" / And in web: SignInWithApple.Authorize() is not implemented on web [RESOLVED] [VUE] Error in iOS: "code":"UNIMPLEMENTED" / And in web: SignInWithApple.Authorize() is not implemented on web Oct 22, 2021
@sbellver
Copy link
Author

With last code, I can set user & password, I close this issue and continue on #60

@katche70
Copy link

katche70 commented Oct 27, 2021

Same Problem here. Used Code from @sbellver , but error is still existing

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

No branches or pull requests

3 participants