dpa99c / cordova-plugin-firebasex

Cordova plugin for Google Firebase
MIT License
569 stars 461 forks source link

(iOS) Migrate to GoogleSignIn v7 #809

Open dpa99c opened 1 year ago

dpa99c commented 1 year ago

Currently this plugin is using GoogleSignIn v6.3.4 for Google Sign capabilities in Firebase Authentication.

However the GoogleSignIn Pod for iOS has been updated to v7.0.0 which makes breaking changes which means the related source code of this plugin will need to be updated in order to migrate.

onlinecoder84 commented 1 year ago

Hi,

I got the error regarding GIDSignInDelegate missing and my pod is:

pod 'Firebase/Core', '10.10.0' pod 'Firebase/Auth', '10.10.0' pod 'Firebase/Messaging', '10.10.0' pod 'Firebase/Performance', '10.10.0' pod 'Firebase/RemoteConfig', '10.10.0' pod 'Firebase/InAppMessaging', '10.10.0' pod 'Firebase/Firestore', '10.10.0' pod 'Firebase/Crashlytics', '10.10.0' pod 'Firebase/Functions', '10.10.0' pod 'Firebase/Installations', '10.10.0' pod 'GoogleSignIn', '7.0.0' pod 'GoogleTagManager', '7.4.3'

I've created the app with Cordova using firebase plugin, build works on Android but with Xcode I have always the same error regarding interfaces that doesn't exists like as (even switching versions):

../Plugins/cordova-plugin-firebasex/FirebasePlugin.m:65:33 No visible @interface for 'GIDSignIn' declares the selector 'handleURL:'

Please help me

dpa99c commented 1 year ago

@onlinecoder84 This plugin has not been migrated to GoogleSignIn v7 yet because it makes breaking changes to the API. So if you set the version of GoogleSignIn to v7 with the current FirebaseX plugin version, your build will fail as above.

TL;DR: use IOS_GOOGLE_SIGIN_VERSION=6.2.4 with the current version of this plugin, submit a PR to migrate the plugin to v7, or wait until I have time to migrate it to v7 and release a new plugin version.

onlinecoder84 commented 1 year ago

Hi @dpa99c ,

I haven't much experience with iOS, the latest project I builded was for iOS 7. I have experience only on Android and I choosed Cordova only for Apple build.
About your suggestion (TL;DR: use IOS_GOOGLE_SIGIN_VERSION=6.2.4 with the current version of this plugin) I don't understand where should I change that property.. Can you explain better? In the end, how can I contact you in private for the migration?

Thanks in advance, have a nice weekend

onlinecoder84 commented 12 months ago

Hi @dpa99c ,

I put IOS_GOOGLE_SIGNIN_VERSION you suggested me in podfile:

DO NOT MODIFY -- auto-generated by Apache Cordova

source 'https://cdn.cocoapods.org/' platform :ios, '11.0' use_frameworks! target 'myproject' do project 'myproject.xcodeproj' pod 'Firebase/Core', '10.10.0' pod 'Firebase/Auth', '10.10.0' pod 'Firebase/Messaging', '10.10.0' pod 'Firebase/Performance', '10.10.0' pod 'Firebase/RemoteConfig', '10.10.0' pod 'Firebase/InAppMessaging', '10.10.0' pod 'Firebase/Firestore', '10.10.0' pod 'Firebase/Crashlytics', '10.10.0' pod 'Firebase/Functions', '10.10.0' pod 'Firebase/Installations', '10.10.0' pod 'GoogleSignIn', '6.2.4'

end

post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf-with-dsym' config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0' config.build_settings['IOS_GOOGLE_SIGIN_VERSION'] = '6.2.4' if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle" config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' end end end end

but I always get the same error on GooglePlus.h: ...platforms/ios/myproject/Plugins/cordova-plugin-googleplus/GooglePlus.h:4:35 No type or protocol named 'GIDSignInDelegate'

Can you help me to understand what's the problem?

dpa99c commented 12 months ago

@onlinecoder84 IOS_GOOGLE_SIGIN_VERSION is (as documented) a plugin variable so changing the value in the Podfile will not be effective since it will be overwritten next time you run cordova prepare.

To change the value of a plugin variable, remove and re-add the plugin with appropriate values for the variable(s):

cordova plugin rm cordova-plugin-firebasex && cordova plugin add cordova-plugin-firebasex --variable IOS_GOOGLE_SIGIN_VERSION=6.2.4

Then either remove and re-add the iOS platform: cordova platform rm ios --nosave && cordova platform add ios

Or manually re-install the Pods: cd plaforms/ios && pod install

onlinecoder84 commented 12 months ago

Hi, @dpa99c ,

I want to thank you for your support. Now the app build has success!

Have a good life!

koromon3 commented 2 months ago

Is there any progress on this matter? I need to use GoogleSignIn 7 series. Thanks.