Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20597] LiveView: Does not work with iOS SDK 9 because missing NSAllowsArbitraryLoads

GitHub Issuen/a
TypeBug
PriorityNone
StatusResolved
ResolutionCannot Reproduce
Resolution Date2017-07-08T22:19:36.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsLiveView
Labelsn/a
ReporterFokke Zandbergen
AssigneeUnknown
Created2016-03-19T12:11:38.000+0000
Updated2018-02-28T19:55:30.000+0000

Description

Since Titanium SDK 5 we [inject](https://github.com/appcelerator/titanium_mobile/blob/31c9c3996583022a7d86b2fcf3f3a44a0611e39b/iphone/cli/commands/_build.js#L3517) and [default](https://github.com/appcelerator/titanium_mobile/blob/bbb64b89eaf8fbe15b74b2d4ede9aba092ad45c3/iphone/iphone/Titanium.plist#L39) to include:
<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>
One of the things that requires this is LiveView. If you are using Titanium SDK 4.x or even 3.x and build against iOS SDK 9 this key will not be injected and LiveView will not work saying:
Couldn't find module: localStrings for architecture: x86_64
Which can be debugged to:
Transport security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
When an app is build with LiveView enabled, LiveView should inject NSAllowsArbitraryLoads so that you can use LiveView with older Titanium SDKs as well. *However*, as found by [~developer82] on [SO](http://stackoverflow.com/a/36088576/4626813) this seem to happen on Titanium 5.x as well. No idea why the key isn't inserted correctly.

Comments

  1. Hans Knöchel 2016-03-20

    I think we should resolve this ticket as invalid. We added support for iOS 9 in Ti.SDK 5.0, so people are encouraged to upgrade if they want to support iOS 9 features.
  2. Ophir Oren 2016-03-20

    I've reported this on SO. I'm using iOS9, the latest Appcelerator Studio and the* latest SDK (5.2.0)*. And I'm having this problem.
  3. Fokke Zandbergen 2016-03-21

    Thanks for the update [~developer82]. Could you remove the key you manually added from tiapp.xml, clean, build and check the generated build/iphone/Info.plist to verify if it indeed is missing the key? Could you also include the full <ios><plist> section of your tiapp.xml?
  4. Hans Knöchel 2017-07-08

    This issue no longer occurs on latest SDK versions (5.x, 6.x) anymore.

JSON Source