Initiate Google Signin without GIDSignInButton, but programmatically

Is there a way to launch Google SignIn programmatically without clicking on GIDSignInButton?

I am trying to wrap a signal on hit google api where the user should log in.

view:

googleSignInSignal().then(getPersonalDataSignal) 
+8
ios reactive-programming swift google-signin reactive-cocoa
source share
5 answers

Instead, you can call this method:

 GIDSignIn.sharedInstance().signIn() 

This worked perfectly for me, and it seems to be a much cleaner approach.

I hope this helps someone with the same question.

+13
source share

You can try something like this - not pretty, but it works:

 GIDSignInButton *googleButton =[[GIDSignInButton alloc] init]; [googleButton sendActionsForControlEvents:UIControlEventTouchUpInside]; 
+1
source share

I answered the answer to the same question , and it works for me. I talked about all the steps and created the signing button output as

 @property (retain, nonatomic) IBOutlet GIDSignInButton *googleSigninbtn; 

and use this button as

 [self.googleSigninbtn sendActionsForControlEvents:UIControlEventTouchUpInside]; 

I will hide this button from the storyboard and add this code to my own button action, and it works.

0
source share

I called GIDSignIn.sharedInstance (). SignIn (), but the Google Canned WebView for OAuth did not appear after the call. In addition, events were not triggered for the configured GIDSignInUIDelegate or GIDSignInDelegate objects.

The problem was that in my UIViewController I called dismiss () before calling signIn (). The Google user interface will not appear if you have already disabled the view controller.

0
source share

In the end I just called

  let signIn = GIDSignIn.sharedInstance() signIn.delegate = self signIn.uiDelegate = uiDelegate if silent { signIn.signInSilently() } else { signIn.signIn() } 
-one
source share

All Articles