Skip to content

Commit 7b44fe5

Browse files
friederbluemlefacebook-github-bot
authored andcommitted
Fix Info.plist templates to prevent parse error (facebook#23924)
Summary: I ran into a build error when `xcodebuild` would invoke a custom script (in my case `sentry-cli`): ``` error: Could not parse Info.plist file caused by: invalid data ``` Upon further investigation it turned out the parse error was **caused by a comment**, and I found some other oddities with the default `Info.plist` template files: - The problematic comment is a **dead link** (website does not exist) - The main Info.plist contains a **duplicate entry** for `NSLocationWhenInUseUsageDescription` - Some entries are _reordered_ and the comment is removed when modifying/saving the file in Xcode This PR fixes these inconsistencies, unnecessary customizations, and potential sources of errors. [iOS] [Fixed] - Fix Info.plist templates to prevent parse error Pull Request resolved: facebook#23924 Differential Revision: D14477557 Pulled By: cpojer fbshipit-source-id: 6d734c5aa3b800f05394db189e8d8db63be8e353
1 parent 25f7657 commit 7b44fe5

File tree

2 files changed

+27
-31
lines changed

2 files changed

+27
-31
lines changed

template/ios/HelloWorld-tvOS/Info.plist

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CFBundleExecutable</key>
88
<string>$(EXECUTABLE_NAME)</string>
99
<key>CFBundleIdentifier</key>
10-
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1111
<key>CFBundleInfoDictionaryVersion</key>
1212
<string>6.0</string>
1313
<key>CFBundleName</key>
@@ -22,6 +22,19 @@
2222
<string>1</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
25+
<key>NSAppTransportSecurity</key>
26+
<dict>
27+
<key>NSExceptionDomains</key>
28+
<dict>
29+
<key>localhost</key>
30+
<dict>
31+
<key>NSExceptionAllowsInsecureHTTPLoads</key>
32+
<true/>
33+
</dict>
34+
</dict>
35+
</dict>
36+
<key>NSLocationWhenInUseUsageDescription</key>
37+
<string></string>
2538
<key>UILaunchStoryboardName</key>
2639
<string>LaunchScreen</string>
2740
<key>UIRequiredDeviceCapabilities</key>
@@ -36,19 +49,5 @@
3649
</array>
3750
<key>UIViewControllerBasedStatusBarAppearance</key>
3851
<false/>
39-
<key>NSLocationWhenInUseUsageDescription</key>
40-
<string></string>
41-
<key>NSAppTransportSecurity</key>
42-
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
43-
<dict>
44-
<key>NSExceptionDomains</key>
45-
<dict>
46-
<key>localhost</key>
47-
<dict>
48-
<key>NSExceptionAllowsInsecureHTTPLoads</key>
49-
<true/>
50-
</dict>
51-
</dict>
52-
</dict>
5352
</dict>
5453
</plist>

template/ios/HelloWorld/Info.plist

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@
2424
<string>1</string>
2525
<key>LSRequiresIPhoneOS</key>
2626
<true/>
27+
<key>NSAppTransportSecurity</key>
28+
<dict>
29+
<key>NSAllowsArbitraryLoads</key>
30+
<true/>
31+
<key>NSExceptionDomains</key>
32+
<dict>
33+
<key>localhost</key>
34+
<dict>
35+
<key>NSExceptionAllowsInsecureHTTPLoads</key>
36+
<true/>
37+
</dict>
38+
</dict>
39+
</dict>
2740
<key>NSLocationWhenInUseUsageDescription</key>
2841
<string></string>
2942
<key>UILaunchStoryboardName</key>
@@ -40,21 +53,5 @@
4053
</array>
4154
<key>UIViewControllerBasedStatusBarAppearance</key>
4255
<false/>
43-
<key>NSLocationWhenInUseUsageDescription</key>
44-
<string></string>
45-
<key>NSAppTransportSecurity</key>
46-
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
47-
<dict>
48-
<key>NSAllowsArbitraryLoads</key>
49-
<true/>
50-
<key>NSExceptionDomains</key>
51-
<dict>
52-
<key>localhost</key>
53-
<dict>
54-
<key>NSExceptionAllowsInsecureHTTPLoads</key>
55-
<true/>
56-
</dict>
57-
</dict>
58-
</dict>
5956
</dict>
6057
</plist>

0 commit comments

Comments
 (0)