-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Handle TargetBinaryVersionMismatch #2 #920
Handle TargetBinaryVersionMismatch #2 #920
Conversation
Fix issue #530. Every so often you run the command react-native link an exception is thrown because the \n in regex does not lead to the line.
* Upgrade example app to react-native@0.37.0 * Fix crash on restart caused by loadBundle() being called twice
@disharmonized, It will cover your contributions to all Microsoft-managed open source projects. |
…e-code-push into add-version-mismatch # Conflicts: # CodePush.js # README.md
CodePush.js
Outdated
@@ -237,7 +240,7 @@ const sync = (() => { | |||
let syncInProgress = false; | |||
const setSyncCompleted = () => { syncInProgress = false; }; | |||
|
|||
return (options = {}, syncStatusChangeCallback, downloadProgressCallback) => { | |||
return (options = {}, syncStatusChangeCallback, downloadProgressCallback, handleBinaryVersionMismatch) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this 4th parameter is callback may be it make sense to add callback postfix to this to avoid confusion (on first sight looks like boolean variable for me, not a function)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
CodePush.js
Outdated
@@ -76,6 +76,9 @@ async function checkForUpdate(deploymentKey = null) { | |||
(!localPackage || localPackage._isDebugOnly) && config.packageHash === update.packageHash) { | |||
if (update && update.updateAppVersion) { | |||
log("An update is available but it is not targeting the binary version of your app."); | |||
if(handleBinaryVersionMismatch && typeof handleBinaryVersionMismatch === "function") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably space is missing between if and brackets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it
@disharmonized, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request. |
LGTM. @sergey-akhalkov - if you could also have a look at this and don't have any concerns I'm ok with merging this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine. Thanks for updating README and Typings.
Added an optional callback function that can be used to notify user if there are any binary updates.