当您将应用程序提交到Apple应用程序商店时,会有一个名为"评级"的部分,您应该根据图表对内容进行评级,并确定内容的显示频率.
有一个名为"Unrestricted web access"的选项,在Internet和iTunes Connect开发人员指南中没有关于此的更多详细信息.你到处都可以找到:
如果您的应用允许用户浏览和查看网页(例如使用嵌入式浏览器),请选择"是".
这是什么意思?这是否意味着您的应用可以在嵌入式或Safari浏览器中打开链接?或者这是否意味着您的应用程序具有浏览器,用户可以在其中输入URL并在网络中无限制地浏览?因为对这个问题说"是"会让你的应用程序超过17岁!

如果这意味着从您的应用程序(Safari或嵌入式)打开链接,那么具有嵌入式浏览器功能的其他应用程序如何获得4+评级(如Twitter和Facebook)?正如在屏幕截图中可以看到的那样,没有办法选择这个并且不被评为17+

更新:我的应用程序已通过嵌入式WebView(TOWebViewController)批准,答案为"否"(4+).正如答案所提到的,任何让用户通过互联网浏览的方式,例如动态地址栏,这意味着它应该是"是"(17+),因为无法在WebView上进行家长控制.
更新2:自iOS 9发布以来,Apple推出了SFSafariViewController,这是一种在互联网上打开任何URL的方式.此功能还有一个地址栏,但只读.因此,如果没有家长控制,用户就无法上网.它还继承了Safari中的内容阻止(广告,显式内容等).我非常积极地使用iOS 9或更高版本的SFSafariViewController你仍然可以选择4+,因为家长控制的设备无论如何也无法打开任何URL.(如果我错了,请告诉我)
更新3:Twitter现在是17岁以上,基于以下几点:
您必须年满17岁才能下载此应用程序.
罕见/温和的亵渎或粗暴的幽默
频繁/激烈的成熟/暗示主题
罕见/轻度的性内容和裸露
更新4:可以在您的应用程序内使用Twitter内容,而无需继承其评级(17+).我的应用程序正在显示推文,但由于用户是经过验证和信任的公众人物,我可以降到12岁以上:
罕见/轻度的性内容和裸露
罕见/温和的亵渎或粗暴的幽默
罕见/温和的成熟/暗示主题
itunesconnect uiwebview appstore-approval ios sfsafariviewcontroller
我SFSafariViewController通过调用presentViewController:animated:completion:一个UIViewController实例来呈现一个.
结果是它被推入(从右侧滑入),就好像我调用pushViewController:animated:了一个UINavigationController实例.我已经验证了这一切都发生在主队列上.并且呈现视图控制器本身不是模态(无论如何都应该无关紧要,但是以防万一,我们可以将其排除在外).
如果我SFSafariViewController用a 替换UIViewController它,它按预期工作,它以模态方式呈现.
weakSelf.oAuthViewController = [[SFSafariViewController alloc] initWithURL:url];
[viewController presentViewController:weakSelf.oAuthViewController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
知道为什么或如何解决这个问题?
我使用适用于iOS的Shopify移动购买SDK,我无法从其付款网络视图中获得回调.由于某种原因警告:
2016-11-25 21:17:25.945267 Drool[3328:799969] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2016-11-25 21:17:25.977316 Drool[3328:799969] Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service
2016-11-25 21:17:26.105947 Drool[3328:799969] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction
Run Code Online (Sandbox Code Playgroud)
继续出现,我不知道为什么会发生这种情况,如果这是造成这个问题的原因,那么你们中的任何人都知道这是什么吗?
在iOS App Search Programming Guide的Universal Links部分中,Apple说:
如果您实例化SFSafariViewController,WKWebView或UIWebView对象以处理通用链接,iOS将在Safari中打开您的网站,而不是打开您的应用程序.但是,如果用户从嵌入式SFSafariViewController,WKWebView或UIWebView对象中点击通用链接,iOS将打开您的应用程序.
"处理通用链接"是什么意思?我不能永远打开给定的URL与SFSafariViewController,WKWebView或UIWebView?它是否仅适用于期间-[UIApplicationDelegate application:continueUserActivity:restorationHandler:],或是否存在超时?这是否意味着在我们永远不能打开的URL SFSafariViewController,WKWebView或UIWebView?
我可以毫无问题地创建Safari View Controller:
let svc = SFSafariViewController(URL: NSURL(string: remote_url)!, entersReaderIfAvailable: true)
self.presentViewController(svc, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)
在将视图控制器呈现给用户之前,有什么方法可以预先加载URL吗?
例如,我可以先在后台预加载URL(Web内容),在用户点击某些内容后,我可以立即向Safari View Controller显示内容.用户将感觉页面加载更快或更快.
PS Workarounds/hacks也是可以接受的.例如,使用缓存或在后台启动视图控制器等.
编辑:请仅考虑SFSafariViewController.
尝试将Facebook OAuth与SafariViewController一起使用.首先,我使用SafariViewController打开authURL,如果用户在Safari上登录到Facebook,将重定向它们并返回带有该特定服务的令牌的OAuth URL,例如Instagram
回应:https://www.facebook.com/connect/login_success.html#access_token=BLAHTOKENRESPONSE&expires_in=5114338
当SafariViewController重定向时,我想获取响应URL并存储它,以便我可以获取令牌.这是我的代码:
import SafariServices
let kSafariViewControllerCloseNotification = "kSafariViewControllerCloseNotification"
import UIKit
// facebook OAuth URL for service
let authURL = NSURL(string: "https://www.facebook.com/dialog/oauth?client_id=3627644767&redirect_uri=https://www.facebook.com/connect/login_success.html&scope=basic_info,email,public_profile,user_about_me,user_activities,user_birthday,user_education_history,user_friends,user_interests,user_likes,user_location,user_photos,user_relationship_details&response_type=token")
class ViewController: UIViewController, SFSafariViewControllerDelegate {
var safariVC: SFSafariViewController?
@IBOutlet weak var loginButton: UIButton!
@IBAction func loginButtonTapped(sender: UIButton) {
safariVC = SFSafariViewController(URL: authURL!)
safariVC!.delegate = self
self.presentViewController(safariVC!, animated: true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
// not firing the safariLogin function below
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ViewController.safariLogin(_:)), name: kSafariViewControllerCloseNotification, object: nil)
}
func safariLogin(notification: …Run Code Online (Sandbox Code Playgroud) 是否可以为safari视图控制器提供自定义标头.
我想用我的请求传递API密钥或身份验证令牌,我不能将它放在查询字符串中.
我的应用程序使用深色导航栏颜色.因此我将状态栏颜色设置为白色(因此它具有很好的对比度).
我通过将barStyle设置为黑色(使状态栏变为白色)并将barTint设置为深红色来完成此操作.完美的工作.
我提出这样的一个SafariViewController:
func openWebsite(urlString: String) {
if let url = NSURL(string: urlString) {
let svc = SFSafariViewController(URL: url)
svc.delegate = self
self.presentViewController(svc, animated: true, completion: nil)
}
}
Run Code Online (Sandbox Code Playgroud)
但是,呈现的状态栏SafariViewController仍为白色.这是一个问题,因为SVC导航栏具有默认的白色透明iOS默认样式.所以状态栏基本上是不可见的.
我该如何解决这个问题?
我正在使用SFSafariViewController,并遇到以下问题:向用户显示上传图像按钮,单击时设备正确显示多个选项,其中一个是相机.当用户选择摄像机时,它会加载摄像机,但屏幕为黑色,操作按钮显示为灰色.但是,如果用户选择库,则会正确上载所选图像.
我确认该应用已启用相机权限.
其他人遇到这个问题?
码:
import UIKit
import SafariServices
class ViewController: UIViewController, SFSafariViewControllerDelegate
{
private var urlString:String = "https://example.com"
override func viewDidLoad()
{
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func viewDidAppear(animated: Bool)
{
super.viewDidAppear(animated)
let svc = SFSafariViewController(URL: NSURL(string: self.urlString)!)
svc.delegate = self
self.presentViewController(svc, animated: true, completion: nil)
}
func safariViewControllerDidFinish(controller: SFSafariViewController) {
super.dismissViewControllerAnimated(true, completion: nil)
}
override func didReceiveMemoryWarning()
{
super.didReceiveMemoryWarning()
// Dispose of any …Run Code Online (Sandbox Code Playgroud) xCode 11.6、iOS 11.4、Objective C 应用程序。从 UIViewController 启动 SFSafariViewController。我的 UIViewController 是 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];
Run Code Online (Sandbox Code Playgroud)
委托方法 safariViewControllerDidFinish 有效。
我在调试窗口中收到以下错误:
[AXRuntimeCommon] AX查找问题 - 的errorCode:1100错误:权限被拒绝PORTNAME: 'com.apple.iphone.axserver' PID:284(0 AXRuntime 0x000000019f8e47b0 1BF005F5-4F9C-3C5B-9FDA-419692AB5039 + 264112 1个AXRuntime 0x000000019f8aa87c _AXGetPortFromCache + 544 2 AXRuntime 0x000000019f8abca0 AXUIElementPerformFencedActionWithValue + 388 3的UIKit 0x00000001cbb503cc 315F0544-BEE8-3A6B-999F-CF5CD922DDE9 + 783308 4 libdispatch.dylib 0x0000000101d82338 _dispatch_call_block_and_release + 24 5 libdispatch.dylib 0x0000000101d83730 _dispatch_client_callout + 16 6 libdispatch.dylib 0x0000000101d85e88 …