Skip to content

Build is overriding custom iOS info.plist file #1533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nraboy opened this issue Feb 23, 2016 · 5 comments
Closed

Build is overriding custom iOS info.plist file #1533

nraboy opened this issue Feb 23, 2016 · 5 comments

Comments

@nraboy
Copy link

nraboy commented Feb 23, 2016

Not sure what happened, but just to be clear this worked fine in 1.5.x.

So I'm sure you're familiar with the iOS 9 App Transport Security (ATS) requirement for accessing URLs that are not HTTPS. The fix was to update the iOS info.plist file as seen here:

https://blog.nraboy.com/2015/12/fix-ios-9-app-transport-security-issues-in-nativescript/

However, now in 1.6.x when I make changes to the info.plist file and build, the changes are replaced.

What is the correct way to create an ATS policy in NativeScript now?

Thanks,

@toddanglin
Copy link

Have you tried creating the settings in a Info.plist file in App_Resources > iOS?

As of 1.6, settings in the plist in App Resources get merged with the default settings in platform > ios.

I'm doing this now in a 1.6 iOS project with ATS policy overrides with no trouble. Give it a try, let me know.

@nraboy
Copy link
Author

nraboy commented Feb 24, 2016

To rule out me doing something silly and saying it doesn't work, can you give me an example of what you're dropping in the App_Resources?

Thanks,

@toddanglin
Copy link

Sure.

In app > App_Resources > iOS > Info.plist I've got something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    ...
  <key>MinimumOSVersion</key>
  <string>8.0</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
  <key>UIDeviceFamily</key>
  <array>
    <integer>2</integer>
  </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
  <key>NSAppTransportSecurity</key>
  <dict>
      <!--Include to allow all connections (DANGER)-->
    <key>NSAllowsArbitraryLoads</key>
        <true/>
  </dict>
</dict>
</plist>

Cut out some of the stuff in the middle, but you get the idea. Hope this helps.

@nraboy
Copy link
Author

nraboy commented Feb 24, 2016

That did it. I didn't realize there was an Info.plist file in there now.

Might want to document this somewhere? I'm sure I won't be the only person that asks as ATS policies are common now lately.

Thanks again!

@nraboy nraboy closed this as completed Feb 24, 2016
@toddanglin
Copy link

Glad it helped. Agree, needs to be documented.

Here is the issue where the feature was discussed pre 1.6:
#1089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants