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

Support for new Google Sign 6.0 on iOS #972

Closed
radko93 opened this issue Jul 13, 2021 · 22 comments
Closed

Support for new Google Sign 6.0 on iOS #972

radko93 opened this issue Jul 13, 2021 · 22 comments

Comments

@radko93
Copy link
Contributor

radko93 commented Jul 13, 2021

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

@vonovak
Copy link
Member

vonovak commented Jul 16, 2021

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! 🙂

@vonovak vonovak pinned this issue Jul 16, 2021
@vonovak
Copy link
Member

vonovak commented Aug 3, 2021

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 💯 🚀 🙂

@vonovak
Copy link
Member

vonovak commented Aug 24, 2021

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

There is still some work to be done, mostly on docs. Please report any findings with this version, thank you! 👍 🚀

@mikehardy
Copy link

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

@vonovak
Copy link
Member

vonovak commented Aug 25, 2021

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 🙈

@mikehardy
Copy link

🏆🏆🏆🏆🏆🏆

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

@mikehardy
Copy link

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

@vonovak
Copy link
Member

vonovak commented Aug 29, 2021

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
Copy link

jslok commented Aug 31, 2021

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

@romonsalve
Copy link

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?

@vonovak
Copy link
Member

vonovak commented Sep 1, 2021

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

yes, iOS 11 is required, that should fix it

thank you 🙁

@Eliajn
Copy link

Eliajn commented Sep 21, 2021

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?

@mikehardy
Copy link

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.

@vonovak
Copy link
Member

vonovak commented Sep 21, 2021

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. :)

@mikehardy
Copy link

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

@Eliajn
Copy link

Eliajn commented Sep 22, 2021

@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!

@ErickCamposDev
Copy link

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?

@vitojuliano
Copy link

vitojuliano commented Sep 29, 2021

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?

@mikehardy
Copy link

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

@vitojuliano
Copy link

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

vonovak added a commit that referenced this issue Oct 2, 2021
BREAKING CHANGE

the signatures of some functions have changed, see #972 (comment)
@vonovak
Copy link
Member

vonovak commented Oct 2, 2021

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

@vonovak vonovak closed this as completed Oct 2, 2021
@vonovak vonovak unpinned this issue Oct 2, 2021
@mikehardy
Copy link

Thanks a bunch @vonovak !

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

8 participants