i am using google sdk for google signin but after entering the email and password
in viewDidLoad i have added delegate
//set Google sign In delegates
The method that get's called is called on GIDSignInUiDelegate, while the method that is not called is called on the GIDSignInDelegate after login. Here's what the GIDSignIn header file says:
@protocol GIDSignInDelegate
- (void)signIn:(GIDSignIn *)signIn didSignInForUser:(GIDGoogleUser *)user withError:(NSError *)error;
@protocol GIDSignInUIDelegate
@optional
- (void)signInWillDispatch:(GIDSignIn *)signIn error:(NSError *)error;
Since you have set both the uiDelegate and the delegate to your UIViewController instance, both methods should get called.
When I encountered the same problem, my mistake was, that I also set the AppDelegate to be the GIDSignInDelegate causing confusion for hours! So my advice: double check if your ViewController still is the delegate of GIDSignIn.sharedInstance when returning from sign in. E.g. set a breakpoint in the callback that get's called:
- (void)signInWillDispatch:(GIDSignIn *)signIn error:(NSError *)error {
if (GIDSignIn.delegate != self) {NSLog("gotcha!")}
}