From 7b44fe56ff201161c8c0106de62adf354812dda5 Mon Sep 17 00:00:00 2001 From: Frieder Bluemle Date: Fri, 15 Mar 2019 03:37:21 -0700 Subject: [PATCH] Fix Info.plist templates to prevent parse error (#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: https://github.com/facebook/react-native/pull/23924 Differential Revision: D14477557 Pulled By: cpojer fbshipit-source-id: 6d734c5aa3b800f05394db189e8d8db63be8e353 --- template/ios/HelloWorld-tvOS/Info.plist | 29 ++++++++++++------------- template/ios/HelloWorld/Info.plist | 29 +++++++++++-------------- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/template/ios/HelloWorld-tvOS/Info.plist b/template/ios/HelloWorld-tvOS/Info.plist index 2fb6a11c2c3..ecbd496be7d 100644 --- a/template/ios/HelloWorld-tvOS/Info.plist +++ b/template/ios/HelloWorld-tvOS/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -22,6 +22,19 @@ 1 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSExceptionDomains + + localhost + + NSExceptionAllowsInsecureHTTPLoads + + + + + NSLocationWhenInUseUsageDescription + UILaunchStoryboardName LaunchScreen UIRequiredDeviceCapabilities @@ -36,19 +49,5 @@ UIViewControllerBasedStatusBarAppearance - NSLocationWhenInUseUsageDescription - - NSAppTransportSecurity - - - NSExceptionDomains - - localhost - - NSExceptionAllowsInsecureHTTPLoads - - - - diff --git a/template/ios/HelloWorld/Info.plist b/template/ios/HelloWorld/Info.plist index 1a61ccf151e..20f7dd5114c 100644 --- a/template/ios/HelloWorld/Info.plist +++ b/template/ios/HelloWorld/Info.plist @@ -24,6 +24,19 @@ 1 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSExceptionDomains + + localhost + + NSExceptionAllowsInsecureHTTPLoads + + + + NSLocationWhenInUseUsageDescription UILaunchStoryboardName @@ -40,21 +53,5 @@ UIViewControllerBasedStatusBarAppearance - NSLocationWhenInUseUsageDescription - - NSAppTransportSecurity - - - NSAllowsArbitraryLoads - - NSExceptionDomains - - localhost - - NSExceptionAllowsInsecureHTTPLoads - - - -