What is the difference between GPPSignIn and GIDSignIn. And in what circumstances should I use either.
2 Answers
GIDSignIn is the class that is part of Google SignIn for iOS. This is the preferred way to sign in from an iOS application. One of the main advantages to using GIDSignIn vs. GPPSignIn is that GPPSignIn switches over to Safari for some users, and Apple does not normally approve an app that switches.
GPPSignIn is part of the PlusAPI, but once you sign in with GIDSignIn, all the other G+ calls will work (just remember to add the correct scopes to the signin request).
Migrating to GIDSignIn is pretty minimal, you can look over a migration guide (it's barely a page): https://developers.google.com/identity/sign-in/ios/quick-migration-guide
- 4,524
- 1
- 16
- 25
-
this is not correct, GIDSignIn as at today, also tansfers the user to Safari, please consider editting your answer above – Edwin O. Dec 25 '15 at 17:17
-
@Edwin - GIDSignin uses the Safari web view vs. switching to the browser application, so the authentication process is handled by your application. Are you seeing different behavior? – Clayton Wilkinson Dec 27 '15 at 16:37
-
but the question i want to ask is does apple approve this ? a couple of people complain that thier app is rejected because of GIDSignIn consulting safari, – Edwin O. Dec 28 '15 at 17:33
-
1@edwin - Yes, Apple recommended using the SafariWebView to authenticate Google APIs, and many applications have been published using it. If your application is rejected when using GIDSignin, please appeal with Apple and let Google know. – Clayton Wilkinson Dec 31 '15 at 07:59
-
@ClaytonWilkinson do you know why I am not able to get back to my view controller after sign in unless I press done button to dismiss sign in view ... – Bhavin Bhadani Sep 02 '16 at 10:35
GPPSignIn : It is basically the sign in related to your Google+ account. When using GPPSignIn API your queries will be made on the data present in user's Google+ profile. like friend list, circles, groups etc.
GIDSignIn : It is the sign in you use for accessing user's Gmail account(google id). It will query things like user's google contacts, google calendar, events, etc.
Note: Unless you need to work on user's Google+ data, GIDSignIn is used.(for things like login and sign up).
Another point to note is that a user may or may not have Google+ account or an active Google+ account.
- 2,049
- 21
- 32
-
-
After you sign in, use the GTMOAuth2Authentication token to retrieve contacts from google. Check this question.. http://stackoverflow.com/questions/26878653/how-to-fetch-gmail-contacts-in-ios-application-using-google-contacts-api – Umar Farooque Mar 15 '16 at 09:32