From e8a160595d1b4d40a6cdeb326d63f12836ae0f61 Mon Sep 17 00:00:00 2001 From: max-mironov Date: Thu, 22 Jun 2017 01:29:55 -0700 Subject: [PATCH 1/2] Fixed incorrect link reference --- docs/api-js.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-js.md b/docs/api-js.md index e85e7bded..3a9ca65cc 100644 --- a/docs/api-js.md +++ b/docs/api-js.md @@ -120,7 +120,7 @@ The `codePush` decorator accepts an "options" object that allows you to customiz * __minimumBackgroundDuration__ *(Number)* - Specifies the minimum number of seconds that the app needs to have been in the background before restarting the app. This property only applies to updates which are installed using `InstallMode.ON_NEXT_RESUME`, and can be useful for getting your update in front of end users sooner, without being too obtrusive. Defaults to `0`, which has the effect of applying the update immediately after a resume, regardless how long it was in the background. -* __updateDialog__ *(UpdateDialogOptions)* - An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use. Defaults to `null`, which has the effect of disabling the dialog completely. Setting this to any truthy value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings. Before enabling this option within an App Store-distributed app, please refer to [this note](#user-content-apple-note). +* __updateDialog__ *(UpdateDialogOptions)* - An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use. Defaults to `null`, which has the effect of disabling the dialog completely. Setting this to any truthy value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings. Before enabling this option within an App Store-distributed app, please refer to [this note](https://github.com/Microsoft/react-native-code-push#user-content-apple-note). The following list represents the available options and their defaults: From 04cb0063fbd6ad98704c6a434bcd29dba282e075 Mon Sep 17 00:00:00 2001 From: max-mironov Date: Fri, 23 Jun 2017 04:57:59 -0700 Subject: [PATCH 2/2] Improved logic for searching plist path (case when package name is not equal to iOS ProductName) --- scripts/postlink/ios/postlink.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/scripts/postlink/ios/postlink.js b/scripts/postlink/ios/postlink.js index 39f0ff56b..68c38bba5 100644 --- a/scripts/postlink/ios/postlink.js +++ b/scripts/postlink/ios/postlink.js @@ -112,19 +112,27 @@ function getBuildSettingsPropertyMatchingTargetProductName(parsedXCodeProj, prop var target; var COMMENT_KEY = /_comment$/; var PRODUCT_NAME_PROJECT_KEY = 'PRODUCT_NAME'; - - if (!targetProductName){ - return target; - } + var TV_OS_DEPLOYMENT_TARGET_PROPERTY_NAME = 'TVOS_DEPLOYMENT_TARGET'; + var TEST_HOST_PROPERTY_NAME = 'TEST_HOST'; var configs = parsedXCodeProj.pbxXCBuildConfigurationSection(); for (var configName in configs) { if (!COMMENT_KEY.test(configName)) { var config = configs[configName]; if ( (build && config.name === build) || (build === undefined) ) { - if (config.buildSettings[prop] !== undefined && config.buildSettings[PRODUCT_NAME_PROJECT_KEY] == targetProductName) { - target = config.buildSettings[prop]; - } + if (targetProductName) { + if (config.buildSettings[prop] !== undefined && config.buildSettings[PRODUCT_NAME_PROJECT_KEY] == targetProductName) { + target = config.buildSettings[prop]; + } + } else { + if (config.buildSettings[prop] !== undefined && + //exclude tvOS projects + config.buildSettings[TV_OS_DEPLOYMENT_TARGET_PROPERTY_NAME] == undefined && + //exclude test app + config.buildSettings[TEST_HOST_PROPERTY_NAME] == undefined) { + target = config.buildSettings[prop]; + } + } } } } @@ -162,6 +170,8 @@ function getPlistPath(){ //Try to get 'Release' build of ProductName matching the package name first and if it doesn't exist then try to get any other if existing var plistPathValue = getBuildSettingsPropertyMatchingTargetProductName(parsedXCodeProj, INFO_PLIST_PROJECT_KEY, targetProductName, RELEASE_BUILD_PROPERTY_NAME) || getBuildSettingsPropertyMatchingTargetProductName(parsedXCodeProj, INFO_PLIST_PROJECT_KEY, targetProductName) || + getBuildSettingsPropertyMatchingTargetProductName(parsedXCodeProj, INFO_PLIST_PROJECT_KEY, null, RELEASE_BUILD_PROPERTY_NAME) || + getBuildSettingsPropertyMatchingTargetProductName(parsedXCodeProj, INFO_PLIST_PROJECT_KEY) || parsedXCodeProj.getBuildProperty(INFO_PLIST_PROJECT_KEY, RELEASE_BUILD_PROPERTY_NAME) || parsedXCodeProj.getBuildProperty(INFO_PLIST_PROJECT_KEY);