firebase - iOS: Google SignIn not working if delegate is not UIApplicationDelete -
i'm trying out google signin authenticate user ios app uses firebase.
after hacking googlesignindependenies.framework file remove duplicate classes, , adding code per instructions on firebase , google sign in sites, got work. part of adding gidsigninprotocol protocol application delegate , implementing code inside func sign(_ signin: gidsignin!, didsigninfor user: gidgoogleuser!, witherror error: error!) method.
i want set class delegate of sign in, when reassign delegate, callback never happens , cannot life of me see why.
@uiapplicationmain class appdelegate: uiresponder, uiapplicationdelegate, gidsignindelegate { var window: uiwindow? func application(_ application: uiapplication, didfinishlaunchingwithoptions launchoptions: [uiapplicationlaunchoptionskey: any]?) -> bool { firebaseapp.configure() return true } public func sign(_ signin: gidsignin!, didsigninfor user: gidgoogleuser!, witherror error: error!) { print("app delegate signin") } } class firebasesecurity:nsobject, gidsignindelegate { override init() { super.init() gidsignin.sharedinstance().clientid = firebaseapp.app()?.options.clientid // works. // gidsignin.sharedinstance().delegate = uiapplication.shared.delegate as! gidsignindelegate // doesn't work gidsignin.sharedinstance().delegate = self } func sign(_ signin: gidsignin!, didsigninfor user: gidgoogleuser!, witherror error: error!) { print("security sign in") } } } flicking 2 lines , forth in security init, can log say:
app delegate signin when tap gidsigninbutton added ui, nothing when switch firebasesecurity delegate.
anyone know why not working?
ok, bad. of course after taking time post found problem.
which had nothing google sign in.
i'd accidentally set firebasesecurity transient instance in container being dealloc'd before logon button pressed. doh!
i'll leave question here though working. perhaps else learn mistake. :-)
Comments
Post a Comment