10.6. We noticed that the user goes to Safari to log in or register for an account, which provides a bad user interface

My application was rejected for the following reason.

10.6 Details We noticed that the user goes to Safari to log in or register for an account, which provides a poor user experience.

Next steps

Please review your application so that users can log in or register an account in the application.

We recommend that you implement the Safari API to display web content in your application. Safari Browser allows you to display the URL and verify the certificate from the in-app browser in the application so that customers can verify the URL of the web page and SSL certificate to confirm that they enter their credentials on a legitimate page.

Resources

For more information about the Safari View Controller API, see the What's New in Safari webpage .

I use Facebook and Google plus login. Is this because of logging into Facebook or Google Plus? Because if the Facebook / Google plus application is not installed on the user's device, it will launch the Safari / default browser for the Facebook / Google + login page. My previous binary construct was approved by the apple, and so far I have not made any changes to the signIn / register stream.

I'm considering implementing what they recommended, but can't figure it out, using the Safari View Controller API to display web content in your application. How to display Facebook / Google + login page using Safari View controller? I'm kinda stuck here. If anyone can share any idea regarding this issue would be much appreciated.

+4
4

, - google + signin. SDK, .

+1

, . Google+ Facebook. AppDelegate.swift(, UIApllicationDelegate). , .

    func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
    //        return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
    let urlString = url.absoluteString as NSString
    let substring = urlString.substringWithRange(NSRange(location: 0, length: 2))
    print("FACEBOOKURL \(substring)")

    if substring == "fb" {
        return FBSDKApplicationDelegate.sharedInstance().application(application,
            openURL: url,
            sourceApplication: sourceApplication,
            annotation: annotation)
    }else {
        return GIDSignIn.sharedInstance().handleURL(url,
            sourceApplication: sourceApplication,
            annotation: annotation)
    }
}

func application(application: UIApplication,
    openURL url: NSURL, options options: [String: AnyObject]) -> Bool {
        let urlString = url.absoluteString as NSString
        let substring = urlString.substringWithRange(NSRange(location: 0, length: 2))
        print("FACEBOOKURL \(substring)")

        if substring == "fb" {
            return FBSDKApplicationDelegate.sharedInstance().application(application,
                openURL: url,
                sourceApplication: options[UIApplicationOpenURLOptionsSourceApplicationKey]! as! String,
                annotation: options[UIApplicationOpenURLOptionsAnnotationKey])
        }else {
            return GIDSignIn.sharedInstance().handleURL(url,
                sourceApplication: options[UIApplicationOpenURLOptionsSourceApplicationKey]! as! String,
                annotation: options[UIApplicationOpenURLOptionsAnnotationKey])
        }

}
0

, SFSafariViewController delegate URL- . , ( C), iTunes.

Framework:

#import <SafariServices/SafariServices.h>

:

-(void)openURLWithSafariController:(NSString*)strUrl
    {
        NSURL *URL = [NSURL URLWithString:strUrl];

        if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0)
        {
            if ([SFSafariViewController class] != nil)
            {
                SFSafariViewController *sfvc = [[SFSafariViewController alloc] initWithURL:URL];
                sfvc.delegate = self;
                [self presentViewController:sfvc animated:YES completion:nil];
            }
            else
            {
                if (![[UIApplication sharedApplication] openURL:URL])
                {
                    NSLog(@"%@%@",@"Failed to open url:",[URL description]);
                }
            }
        }
        else
        {
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:URL]];
        }
    }


    #pragma Safari View Controller Delegate

    - (void)safariViewControllerDidFinish:(nonnull SFSafariViewController *)controller
    {
        [controller dismissViewControllerAnimated:YES completion:nil];
    }

:

[self openURLWithSafariController:@"Pass some valid URL which you have tried to open in external browser"];

, - .

0

WebView

WebView - .

WebView, "" " reset" , Safari.

This looks good if your site supports mobile browsers.

0
source

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


All Articles