I am using the Google GTMAppAuth with my swift project for authorisation. The thing is, I don't know what to put as a Rediret URL. I couldn't find anything on stack or anywhere else about what it is supposed to be. I am new to the google api so help would be appreciated.
-
Which api are you going to work with? and what type of credentials did you create? – Linda Lawton - DaImTo Apr 18 '17 at 07:40
-
I'm having the same issue. I generate a client ID via https://console.developers.google.com/apis/credentials?project= but don't understand the redirect URL – Nic Cottrell Jul 06 '17 at 20:38
-
I believe this has been answered at https://stackoverflow.com/questions/13281084/whats-a-redirect-uri-how-does-it-apply-to-ios-app-for-oauth2-0 – Nic Cottrell Jul 07 '17 at 08:21
1 Answers
After Successful creation of oauth2 credentials (https://console.developers.google.com/projectselector/apis/credentials) you will get client ID for your project.
Follow the below instructions...
kRedirectURI is reverse DNS notation form of the client ID. For example, if the client ID is YOUR_CLIENT.apps.googleusercontent.com, the reverse DNS notation would be com.googleusercontent.apps.YOUR_CLIENT. A path component is added resulting in com.googleusercontent.apps.YOUR_CLIENT:/oauthredirect.
Finally, open Info.plist and fully expand "URL types" (a.k.a. "CFBundleURLTypes") and replace com.googleusercontent.apps.YOUR_CLIENT with the reverse DNS notation form of your client id (not including the :/oauthredirect path component).
Once you have made those three changes, the sample should be ready to try with your new OAuth client.

- 274
- 2
- 25