capacitor-community / apple-sign-in

Sign in with Apple Support
MIT License
135 stars 58 forks source link

Capacitor 3 Support #52

Closed selected-pixel-jameson closed 2 years ago

selected-pixel-jameson commented 2 years ago

@mlynch According to this issue, https://github.com/rlfrahm/capacitor-apple-login/issues/3, you forked this repo to maintain it and provide support because it's necessary. However, right now there is no way that I can get this working with Capacitor 3.

This paired with the fact that capacitor-community/facebook-login is no longer supporting capacitor version 2, https://github.com/capacitor-community/facebook-login/issues/63, makes it impossible for us to move forward with any kind of updates that facebook is requiring and will thus leave our authentication for any kind of app that supports third-party auth in disarray when it comes to using the capacitor framework since Apple requires you implement Apple Sign In if you implement any other third-party Auth.

It looks like the updates were made in the master branch to support Cap version 3? Is this not the case? We desperately need this to support Capacitor Version 3.

I have version 1.0.0 installed, yet when I try to do an iOS Build I'm getting the following error.

ERROR in node_modules/@capacitor/core/types/definitions-internal.d.ts:16:18 - error TS2430: Interface 'CapacitorInstance' incorrectly extends interface 'CapacitorGlobal'.
  Types of property 'Plugins' are incompatible.
    Property 'SignInWithApple' is missing in type '{ [pluginName: string]: { [prop: string]: any; }; }' but required in type 'PluginRegistry'.

16 export interface CapacitorInstance extends CapacitorGlobal {
                    ~~~~~~~~~~~~~~~~~

  node_modules/@capacitor-community/apple-sign-in/dist/esm/definitions.d.ts:3:9
    3         SignInWithApple: SignInWithApplePlugin;
              ~~~~~~~~~~~~~~~
    'SignInWithApple' is declared here.

[ERROR] An error occurred while running subprocess ng.
selected-pixel-jameson commented 2 years ago

I've tried what is posted in this issue https://github.com/capacitor-community/apple-sign-in/issues/22, but then I get the same result it's just giving me a type error saying it cannot find the @capacitor-community/apple-sign-in module.

Valericoe commented 2 years ago

It seems to be a distribution issue

A messy workaround:

  1. npm i @capacitor-community/apple-sign-in
  2. Download the latest version from GitHub
  3. Overwrite the contents of your /node_modules/@capacitor-community/apple-sign-in

Since we're modifying node_modules this change is easily overwritten, but it does work on my test device.

The following configuration didn't work for me, but it's closer to what we're trying to accomplish: "@capacitor-community/apple-sign-in": "github:capacitor-community/apple-sign-in"

selected-pixel-jameson commented 2 years ago

@Valericoe Yes, this is not a production level solution. I ended up clone my own repo doing a build and then copying the dist/folder into the node_modules/@capacitor-community/apple-sign-in folder just so I could see if this even was working.

I was able to verify that it's working at least, which is a good thing. It would be very much appreciated if @mlynch or @epicshaggy or one of the other contributors would release a new version on NPM so that we can move forward.

selected-pixel-jameson commented 2 years ago

@mlynch @rdlabo @epicshaggy All we need is a new build to be published to NPM please and thank you.

jcesarmobile commented 2 years ago

There has been a mixup of versions, latest version (0.1.2) was compatible with Capacitor 3 already, while version 1.0.0 wasn't, not sure why it was published with a major version bump 8 months ago and then continued doing patch/minor bumps from 0.x.x

I've published 1.0.1 with latest changes