Google Sign-In

Hi,


I have follow Google Sign-In for iOS instruction and everything working fine and I'm able to sign-in to Google and get the user privilege to access his information.

Apple reject my app because of that and want me to use "Safari View Controller API to display web content within your app".

The follows is the link to Google Sign-in for iOS:

https://developers.google.com/identity/sign-in/ios/


Is Google instructions are wrong?

How can I solve this issue?

Can we see the exact/complete rejection wording, thanks.

Seems pretty clear. Apple is requesting that you integrate the sign in process into your app instead of sending users to Safari. They suggest the embedded Safari view controller as a way to do this without having to exit the app. This should be pretty easy for you to do.

Thanks but I didn't understand what I need to change and where?

I have followed the instructions from Google and I don't know where to insert the SFSafariViewController in the implementation process.

BTW, it is working fine without it but it must be change in order to approve the app.

Same isseu at our end, our app is also rejected by Apple for same reason, any idea how to tackle this?

Hi! Have you found any solution to this? I have the same problem...

I would expect they are suggesting using https://developer.apple.com/library/ios/documentation/SafariServices/Reference/SFSafariViewController_Ref/

This gives the user an interface that they can feel secure about in that it is designed to prohibit an application from manipulating the web page so they can feel secure in entering their credentials.

Adjusted to try and avoid moderation...


If you need code then...

In the view controller that needs to present the logon...

Adopt the SFSafariViewControllerDelegate protocol

Add a property or instance variable in the .m file

@property (nonatomic, strong) SFSafariViewController *mySafariWebView;

In the place where you want to present the web view

NSURL *tmpURL = [[NSURL alloc] initWithString:@"http://www.apple.com"];

self.mySafariWebView = [[SFSafariViewController alloc] initWithURL:tmpURL];

[self.mySafariWebView setDelegate:self];

[self.navigationController presentViewController:self.mySafariWebView animated:YES completion:nil];

You will then need to implement

- (void)safariViewControllerDidFinish:(SFSafariViewController *)controller {

[controller dismissViewControllerAnimated:YES completion:nil];

do any additional stuff needed after the user tapped done by your code

}

This will dissmiss the web view and show the previous screen.

The delegate protocol documentation....

https://developer.apple.com/library/ios/documentation/SafariServices/Reference/SFSafariViewControllerDelegate/index.html#//apple_ref/occ/intfm/SFSafariViewControllerDelegate/safariViewController:didCompleteInitialLoad:

Safari webview class

https://developer.apple.com/library/ios/documentation/SafariServices/Reference/SFSafariViewController_Ref/#//apple_ref/occ/instm/SFSafariViewController/initWithURL:entersReaderIfAvailable:

This is iOS 9 and later, if you need to support iOS 8, you should likely use the WKWebView

https://developer.apple.com/library/ios/documentation/WebKit/Reference/WKWebView_Ref/#//apple_ref/occ/instp/WKWebView/configuration

Google Sign-In
 
 
Q