我可以在没有 https 的情况下将我的应用发布到应用商店吗?

Can I publish my app to App store without https?

我是 iOS 开发新手,我想将我的第一个应用发布到应用商店。但实际上我从后端人员那里得到的端点只是 http,而不是 https。

我朋友说必须是https,不然苹果会拒绝我的应用在应用商店发布?是真的吗?

如果我在 .plist 文件中的 NSAppTransportSecurity 字典下将 NSAllowsArbitraryLoads 键设置为 YES。如下图所示,我还能使用 http 连接将我的应用发布到应用商店吗? (没有 https)

你的朋友大部分是对的。但我会说 Apple 可能 拒绝您的应用程序。您需要提供使用 NSAllowsArbitraryLoads 的理由。 来自苹果的文档:

You must supply a justification during App Store review if you set the key’s value to YES, as described in Provide Justification for Exceptions. Use this key with caution because it significantly reduces the security of your app. In most cases, it’s better to upgrade your servers to meet the requirements imposed by ATS, or at least to use a narrower exception. source

如果您使用的是 HTTP,则无需担心。只需将 NSAllowsArbitraryLoads 放入您的 info.plist 文件。

有太多误导性信息。但根据我的经验,无论您使用的是 HTTP 还是 HTTPs.

,都更喜欢和强制放置 NSAllowsArbitraryLoads

重要提示:

  • 在这两种情况下,我都使用过 HTTP 和 HTTPs 两种类型的连接,我习惯将 NSAllowsArbitraryLoads 添加到 info.plist 中。我从来没有因此而遭到任何形式的拒绝。所以我建议你也这样做。

希望对大家有所帮助。