@algocare/react-native-code-push 11.2.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CodePush.js +8 -4
  2. package/package.json +1 -1
package/CodePush.js CHANGED
@@ -8,8 +8,9 @@ let NativeCodePush = require('react-native').NativeModules.CodePush
8
8
  const PackageMixins = require('./package-mixins')(NativeCodePush)
9
9
 
10
10
  async function checkForUpdate(
11
- prNumber,
12
- packageHash,
11
+ prNumber = null,
12
+ packageHash = null,
13
+ deploymentKey = null,
13
14
  handleBinaryVersionMismatchCallback = null
14
15
  ) {
15
16
  /*
@@ -29,7 +30,9 @@ async function checkForUpdate(
29
30
  * dynamically "redirecting" end-users at different
30
31
  * deployments (e.g. an early access deployment for insiders).
31
32
  */
32
- const config = nativeConfig
33
+ const config = deploymentKey
34
+ ? { ...nativeConfig, ...{ deploymentKey } }
35
+ : nativeConfig
33
36
 
34
37
  // Use dynamically overridden getCurrentPackage() during tests.
35
38
  const localPackage = await module.exports.getCurrentPackage()
@@ -202,7 +205,7 @@ async function checkForUpdate(
202
205
  remotePackage.failedInstall = await NativeCodePush.isFailedUpdate(
203
206
  remotePackage.packageHash
204
207
  )
205
- remotePackage.deploymentKey = nativeConfig.deploymentKey
208
+ remotePackage.deploymentKey = deploymentKey || nativeConfig.deploymentKey
206
209
  return remotePackage
207
210
  }
208
211
  }
@@ -564,6 +567,7 @@ async function syncInternal(
564
567
  const remotePackage = await checkForUpdate(
565
568
  syncOptions.prNumber,
566
569
  syncOptions.packageHash,
570
+ syncOptions.deploymentKey,
567
571
  handleBinaryVersionMismatchCallback
568
572
  )
569
573
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algocare/react-native-code-push",
3
- "version": "11.2.0",
3
+ "version": "12.0.0",
4
4
  "description": "React Native plugin for the CodePush service",
5
5
  "main": "CodePush.js",
6
6
  "typings": "typings/react-native-code-push.d.ts",