Google plus API does not return to application on login

Obviously I'm missing something.

When I click the Google + button, it opens safari and login tips. Everything is fine until I complete the login. Safari tells me: "Cannot open the page - Safari cannot open the page because the address is not valid." It never brings me back to my application, but keeps Safari open and goes to google.com.

I thought this would take care of this, but in this method it will not be possible to break the glasses. Perhaps I do not understand how this works.

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [GPPURLHandler handleURL:url sourceApplication:sourceApplication annotation:annotation]; } 

Thanks for any help you can provide.

+4
source share
2 answers

Look at the Bundle ID that is in your project and that you have registered at https://code.google.com/apis/console . Both must be the same. After that, make sure that you also set the same URL schemes in the URL types in your application plist file.

+25
source

I had the same problem today. I finally compared the sample application (w / SDK included) in turn, before I understood my problem.

I did not understand that the ClientID found in the Developer Console was in the standard domain name order, and the URL scheme for 1 of 2 types of URLs in the project settings (Info.plist) should be in the format of the reverse domain name

ClientID in Developer Console - [guid].apps.googleusercontent.com

URL scheme in Info.plist com.googleusercontent.apps.[guid]

0
source

Source: https://habr.com/ru/post/1495640/


All Articles