sfsafariviewcontroller

Why is SFSafariWebViewController not sharing cookies with Safari properly?

爱⌒轻易说出口 提交于 2021-02-17 21:58:26
问题 I created an incredibly basic app which includes a SFSafariViewController pointing at the URL http://www.w3schools.com/js/js_cookies.asp . This is a test website for reading and writing cookies. I then loaded the same website into Mobile Safari, and added one cookie. I switched to my app, read the cookie, it's there. I go back to Safari, add another cookie, go back to my app, but the second cookie hasn't appeared. I refresh the pages, no difference. Go back to Safari and read the cookies,

AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID

戏子无情 提交于 2021-02-07 12:01:25
问题 xCode 11.6, iOS 11.4, Objective C app. Launching a SFSafariViewController from a UIViewController. My UIViewController is the delegate of the SFSafariViewController. NSString *sURL = [dctData objectForKey:@"URL"]; NSURL *URL = [NSURL URLWithString:sURL]; safari = [[SFSafariViewController alloc] initWithURL:URL]; [_safari setDelegate: self]; [self presentViewController:_safari animated:YES completion:nil]; The delegate method safariViewControllerDidFinish works. I receive the following error

Force SFSafariViewController to load the desktop version of a website

…衆ロ難τιáo~ 提交于 2021-01-28 20:41:06
问题 As the title suggests, I was wondering if there is a way to force SFSafariViewController to load the desktop version of a website. Thanks 回答1: As of iOS 9, sadly no. Your best bet might be to create your own web view and use a different user agent as @vizllx suggests in the comments. 回答2: You can use WKWebView and then set the customUserAgent property of the web view to any desktop browser user-agent. 来源: https://stackoverflow.com/questions/35130073/force-sfsafariviewcontroller-to-load-the

iOS Firebase Auth Domain visible to users

谁说胖子不能爱 提交于 2021-01-27 19:24:36
问题 I have searched for solutions to this issue but everything I've found seems to be applicable to a firebase web app, not to iOS implementations. When verifying a user using firebase phone auth for iOS, I understand the recaptacha is very unlikely to appear. However in the event it does, it creates a webview for the recaptcha like so: Is there any way for me to hide the myProjectId-12345.firebaseapp.com from the user? It's not very clean or secure I'm afraid. I haven't been able to find

Handle completion if no success when opening url with SafariViewController

空扰寡人 提交于 2020-08-09 13:59:42
问题 Is there a way to handle the case if SafariViewController fails to open a url like you can with UIApplication.shared.open ? This is my function: if ["http", "https"].contains(url.scheme?.lowercased() ?? "") { // Can open with SFSafariViewController let safariViewController = SFSafariViewController(url: url) self.present(safariViewController, animated: true) { // no bool given? } } else { // Scheme is not supported or no scheme is given, use openURL guard let url = URL(string: urlString) else

Handle completion if no success when opening url with SafariViewController

情到浓时终转凉″ 提交于 2020-08-09 13:59:07
问题 Is there a way to handle the case if SafariViewController fails to open a url like you can with UIApplication.shared.open ? This is my function: if ["http", "https"].contains(url.scheme?.lowercased() ?? "") { // Can open with SFSafariViewController let safariViewController = SFSafariViewController(url: url) self.present(safariViewController, animated: true) { // no bool given? } } else { // Scheme is not supported or no scheme is given, use openURL guard let url = URL(string: urlString) else

Safari Web Extension - injecting script only when extension button is clicked

非 Y 不嫁゛ 提交于 2020-07-31 05:45:38
问题 To keep it simple, I am taking reference for SeaCreator extension example from Apple. You can take it from here: https://drive.google.com/file/d/1loBDgkJAEtyh0QehOUlgOSyUnW9ZZDk6/view?usp=sharing In this example as mentioned, we are replacing fish names with different emojis . The thing is when we tap on the extension icon, it turns into blue to indicate the extension is active and whenever any page is rendered, all fish names will be automatically replaced with emojis. See screenshot -> What

Closes SFSafariViewController on a certain url

↘锁芯ラ 提交于 2020-06-14 07:01:49
问题 I am trying to close SFSafariViewController when I reach a certain page. But I am unable to do it until the "Done" button is pressed explicitly by the user. What I want is to get the URL as soon as it reached a certain page and then dismiss the view controller. Then I can pick the rest using this func safariViewControllerDidFinish(_ controller: SFSafariViewController){ // do work here } Note: This question has been asked before but I was unable to find any satisfactory answers 回答1: If you

SFSafariViewController crash: The specified URL has an unsupported scheme

谁说我不能喝 提交于 2020-01-12 04:52:11
问题 My code: if let url = NSURL(string: "www.google.com") { let safariViewController = SFSafariViewController(URL: url) safariViewController.view.tintColor = UIColor.primaryOrangeColor() presentViewController(safariViewController, animated: true, completion: nil) } This crashes on initialization only with exception: The specified URL has an unsupported scheme. Only HTTP and HTTPS URLs are supported When I use url = NSURL(string: "http://www.google.com") , everything is fine. I am actually loading

How to remove SFSafariViewController as a child view controller correctly?

谁说胖子不能爱 提交于 2019-12-23 07:11:12
问题 I am using the technique provided by this SO answer to preload some URL in SFSafariViewController like this: addChildViewController(svc) svc.didMoveToParentViewController(self) view.addSubview(svc.view) And I try to remove the Safari View controller with following code: svc.willMoveToParentViewController(nil) svc.view.removeFromSuperview() svc.removeFromParentViewController() Now I can preload the URL and show the Safari View without problem. However, after I repeat the process (preload/show