react-native-google-signin/google-signin

Support for new Google Sign 6.0 on iOS

Closed this issue Β· 22 comments

A completely new open source Google Sign library was released, seems like it's not backwards compatible https://github.com/google/GoogleSignIn-iOS

hello Radek, thanks for the info!

Seems like there was a bunch of breaking changes done according to the release notes https://developers.google.com/identity/sign-in/ios/release but overall, it seems like the api is now somewhat nicer to work with. πŸ‘

As I stated in #942 I currently do not use this module in production and I no longer spend much of my free time on this package.

So if anyone is interested in implementing v6 in this package, they can go ahead and submit a PR which I will happily review and merge.

Otherwise, I'll try this as an experiment: I have added a sponsorship tier for this and if enough people chip in, I will implement this from the crowdsourced funding. Let's see where this gets πŸ˜„

Thanks! πŸ™‚

Just wanted to confirm that the work has been funded and I will get this done over the coming weeks: https://twitter.com/vonovak/status/1420380071676743688?s=20 πŸ’― πŸš€ πŸ™‚

hello, the new version of this package that depend on Google Sign In SDK v6 on iOS and supports com.google.android.gms:play-services-auth:19.2.0 on android (see https://github.com/react-native-google-signin/google-signin/blob/feat/use-latest-sdk/docs/android-guide.md#2-installation)

can be installed via yarn add @react-native-google-signin/google-signin@alpha

Please see the api here: https://github.com/react-native-google-signin/google-signin/blob/feat/use-latest-sdk/src/GoogleSignin.ts

the changes include

  • new addScopes call on ios, see google/GoogleSignIn-iOS#23 (that means scopes param sent to configure() only works on android).
  • hint used to be a param of configure(), now is a param of signIn
  • new openIdRealm and profileImageSize params to configure()

There is still some work to be done, mostly on docs. Please report any findings with this version, thank you! πŸ‘ πŸš€

Hey @vonovak I attempted to use the @alpha tag (and verified it is correlated to the 7.0.0.alpha.1 version on npmjs, but it appears to be missing the podspec?

I didn't trust myself so I took some effort to verify I wasn't crazy, I believe this is reasonable proof?

# do not pollute your current directory
mkdir temp && pushd temp
# get the raw package tarball from the registry
npm pack @react-native-google-signin/google-signin@alpha
# get a listing of contents, grep for the podspec, it's empty ?
tar -ztvf react-native-google-signin-google-signin-7.0.0-alpha.0.tgz |grep podspec
# make sure we're not crazy, grep for any ios files, this returns a few
tar -ztvf react-native-google-signin-google-signin-7.0.0-alpha.0.tgz |grep ios
# cleanup
popd && \rm -fr temp

The package.json contains the podspec in it's files array but I think the issue is the name is wrong:

"react-native-google-signin-google-signin.podspec",

vs RNGoogleSignin.podspec in the repo on the feature branch

I will proceed with testing by raw downloading the podspec from the repo

hi @mikehardy thanks for reporting, this should be fixed in 7.0.0.alpha.1 (7.0.0.alpha.0 was available previously).

I renamed the generated podspec because the filename was so long and forgot to do the change in package.json πŸ™ˆ

πŸ†πŸ†πŸ†πŸ†πŸ†πŸ†

Tested google signin with the alpha here and it is working in my project on iOS (on Apple Silicon / M1 with react-native 0.65.1 and with Xcode 13 beta5 no less)

Here's the patch-package patch I'm using to drop the podspec in (it's verbatim from the repo) in case others want to run this

react-native-google-signin+google-signin+7.0.0-alpha.0.patch.zip

Also tested the android signin bit everything looks great for my use cases

Confirmed 7.0.0-alpha.1 needs no patch to work for all my use cases, at least on Apple Silicon + react-native 0.65. I won't be testing anything lower than 0.65 but I will test Apple x86_64 later today, you can assume it's πŸ’― unless I say anything.

This is really excellent - it was the last piece needed for a pretty big app to work on Apple Silicon without anything other than podfile hacks

Speaking of which, in case anyone else is testing react-native 0.65 and a mixed environment of Apple Silicon macs and Intel macs, here's my current set of Podfile hacks to make things compile everywhere

post_install do |installer|
    react_native_post_install(installer)

    installer.aggregate_targets.each do |aggregate_target| 
      aggregate_target.user_project.native_targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)']
          # without explicitly clearing this out, it flaps between excluding arm64 or not
          config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = ""
          # Fix some library / linker errors
          config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
          config.build_settings['VALID_ARCHS'] = 'arm64 x86_64'
          config.build_settings['EXCLUDED_ARCHS'] = 'i386'
        end
      end
      aggregate_target.user_project.save
    end

    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|

        # We support a smaller range of deployment than some libraries, eliminate related noise
        # This also avoids a nasty Folly bug about an API not available until ios10+
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $iOSMinimumDeployVersion

        # Using the un-qualified names means you can swap in different implementations, for example ccache
        config.build_settings["CC"] = "clang"
        config.build_settings["LD"] = "clang"
        config.build_settings["CXX"] = "clang++"
        config.build_settings["LDPLUSPLUS"] = "clang++"
      end
    end

    # If you move versions around though you get another nasty Folly bug about redefined symbols, fix that...
    `sed -i -e  $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
  end
end

hello, I just published 7.0.0-alpha.3 which, I believe, will be promoted to the stable version! πŸš€ The docs at https://github.com/react-native-google-signin/google-signin/tree/feat/use-latest-sdk are also updated.

Please let me know if you run into any issues, otherwise I'll circle back to this at some point and merge to master. Thanks! πŸ’―

jslok commented

Alpha 3 works great! Drop in replacement. Thanks!

I can finally build and run on an m1 mac after also adding the podfile workaround here facebook/react-native#31941

Im trying to test this update but I'm getting this error when i run pod install

[!] CocoaPods could not find compatible versions for pod "RNGoogleSignin":
  In Podfile:
    RNGoogleSignin (from `../node_modules/@react-native-google-signin/google-signin`)

Specs satisfying the `RNGoogleSignin (from `../node_modules/@react-native-google-signin/google-signin`)` dependency were found, but they required a higher minimum deployment target.

My target is iOS 10, so maybe is another problem?

My target is iOS 10, so maybe is another problem?

yes, iOS 11 is required, that should fix it

thank you πŸ™

after installing the npm packagev7.0.0-alpha.3 and trying to pod install I get the following error:

[!] CocoaPods could not find compatible versions for pod "RNGoogleSignin":
  In Podfile:
    RNGoogleSignin (from `../node_modules/@react-native-google-signin/google-signin`)

Specs satisfying the `RNGoogleSignin (from `../node_modules/@react-native-google-signin/google-signin`)` dependency were found, but they required a higher minimum deployment target.

I cant find RNGoogleSignin in pods to change its deployment target.

any suggestions please?

Hi there @Eliajn

I cant find RNGoogleSignin in pods to change its deployment target.

You don't change the minimum deployment target of the module, we set that to the minimum that will work for the module's code, and you simply must conform in order to use the module. If the minimum is not acceptable, then whatever version is the version before the change that moved to an unnacceptable / higher minimum version is simply the last you can use until you can bump your own minimum in your Podfile.

Right now the minimum is 11 on the new SDK branch:

s.platforms = { :ios => "11.0" }

I thought that might be driven by the transitive dependency to the underlying GoogleSignIn-SDK but it appears to work down to 9 https://github.com/google/GoogleSignIn-iOS/blob/bf4583510d487ebc4a22d2a96f9fdc229aa8e8d6/GoogleSignIn.podspec#L15-L16

So this appears to be something about the implementation here and maybe @vonovak has more information

That said, react-native 0.65 has bumped the minimum to 11, so it's a reasonable requirement at this point.

hello, as Mike said, I bumped the minimum to ios 11 because of the example RN project I used for development. I guess there is no issue in bringing it down to 10. :)

Ah, if there was no specific reason then, @Eliajn you can always reach right into the .podspec file in node_modules/react-native-google-signin and manually alter it to 10 to make sure it works. Knowing it works if you test it would actually be really useful! https://github.com/ds300/patch-package may be used to make that change permanent for you (with notification on new releases here) so it's maintainable for you

@mikefowler, it worked when I set the deployment target to 11 in the podile. no need to make changes specific to me.
Thank you guys for the support, cheers!

Estou tentando testar esta atualização, mas recebo este erro quando executo a instalação do pod

[!] CocoaPods could not find compatible versions for pod "RNGoogleSignin":
  In Podfile:
    RNGoogleSignin (from `../node_modules/@react-native-google-signin/google-signin`)

Specs satisfying the `RNGoogleSignin (from `../node_modules/@react-native-google-signin/google-signin`)` dependency were found, but they required a higher minimum deployment target.

Meu alvo Γ© o iOS 10, entΓ£o talvez haja outro problema?

after installing the npm packagev7.0.0-alpha.3 and trying to pod install I get the following error:

[!] CocoaPods could not find compatible versions for pod "RNGoogleSignin":
  In Podfile:
    RNGoogleSignin (from `../node_modules/@react-native-google-signin/google-signin`)

Specs satisfying the `RNGoogleSignin (from `../node_modules/@react-native-google-signin/google-signin`)` dependency were found, but they required a higher minimum deployment target.

I cant find RNGoogleSignin in pods to change its deployment target.

any suggestions please?

i've the same problem, have you found a solution?

i've the same problem, have you found a solution?

Yes, i have same issue here.. when i'm trying to change my podfile to ios : 11.0, its still returning an error.. can anybody share a solution so i can try to solve this problem, please?

This comment should get you moving @vitojuliano #972 (comment)

This comment should get you moving @vitojuliano #972 (comment)

After i read 1 more times from top to bottom, i realize that the solution has been mention by @mikehardy but maybe not too clear for me personally..

I solved my problem with this

node_modules > @react-native-google-signin > google-signin > RNGoogleSignin.podspec

change this
s.platforms = { :ios => "11.0" }

to this
s.platforms = { :ios => "10.0" }

as simple as that i solved it.. maybe you can try this my friend @ErickCamposDev

Thank you all :) hopefully it will help

I released v7 and changed the supported platform to iOS 10. Hope this helps! :)

Thanks a bunch @vonovak !