As per the situation described, that a user has skipped the authentication process of Google Sign in or has navigate to Home Screen by tapping home button.
1st Way:-
On that basis, GPPSignInDelegate never gets called
- (void)finishedWithAuth: (GTMOAuth2Authentication *)auth
error: (NSError *) error {
NSLog(@"Received error %@ and auth object %@",error, auth);
}
Now, if the developer is saving the Google Plus auth key in NSUserDefault or a in a plist or in local DB , then he directly check it in didBecomeActive method of AppDelegate .
-(void)applicationDidBecomeActive:(UIApplication *)application
{
//Check whether Google Plus auth key is present from the stored location or variable
}
2nd Way:-
In applicationDidBecomeActive method one can directly check if authentication is completed or not
-(void)applicationDidBecomeActive:(UIApplication *)application
{
if ([[GPPSignIn sharedInstance] authentication]) {
// The user has signed in properly
}
else
{
// The user has not signed in properly
}
}