@algocare/react-native-code-push 11.1.2 → 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.
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
  }
@@ -562,6 +565,8 @@ async function syncInternal(
562
565
 
563
566
  syncStatusChangeCallback(CodePush.SyncStatus.CHECKING_FOR_UPDATE)
564
567
  const remotePackage = await checkForUpdate(
568
+ syncOptions.prNumber,
569
+ syncOptions.packageHash,
565
570
  syncOptions.deploymentKey,
566
571
  handleBinaryVersionMismatchCallback
567
572
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algocare/react-native-code-push",
3
- "version": "11.1.2",
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",
@@ -179,6 +179,8 @@ export interface RemotePackage extends Package {
179
179
  }
180
180
 
181
181
  export interface SyncOptions {
182
+ prNumber?: string
183
+ packageHash?: string
182
184
  /**
183
185
  * Specifies the deployment key you want to query for an update against. By default, this value is derived from the Info.plist
184
186
  * file (iOS) and MainActivity.java file (Android), but this option allows you to override it from the script-side if you need to