NSAllowsArbitraryLoadsInWebContent in CN1

烈酒焚心 提交于 2019-12-01 00:25:29

I don't understand what steps you were trying to take, but if you are trying to allow http URLs in your application, Codename one made it simple by allowing you to add this build hint

ios.plistInject=<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/></dict><key>CFBundleURLTypes</key><array><dict><key>CFBundleURLName</key><string>com.mycompany.myapp</string></dict><dict><key>CFBundleURLSchemes</key><array><string>MyApp</string></array></dict></array> 

Change com.mycompany.myapp and MyApp accordingly.

Just add that build hint and your http / https URLs will work seamlessly on all iOS versions including iOS 9 and 10.

I currently use this on some of my apps and it works fine, tested on 10.1 beta 3 as well.

EDIT:

After reading your question again, I realized that your questions were not answered:

Yes, the key will work even if BrowserComponent doesn't expose UIWebView. (Based on personal test)

Just use NSAllowsArbitraryLoads and set it to true as discussed above, and it will handle everything. NSAllowsArbitraryLoads will only be ignored in iOS 10 if you set NSAllowsArbitraryLoadsInWebContent.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!