This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
android/app/src/main/java/com/microsoft/codepush/react Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ async function checkForUpdate(deploymentKey = null) {
4040 * in any updates for current app store version, regardless of hash.
4141 */
4242 let queryPackage ;
43- if ( localPackage && localPackage . appVersion && localPackage . appVersion === config . appVersion ) {
43+ if ( localPackage ) {
4444 queryPackage = localPackage ;
4545 } else {
4646 queryPackage = { appVersion : config . appVersion } ;
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ public String getBundleUrl(String assetsBundleFileName) {
162162 } else {
163163 // The binary version is newer.
164164 didUpdate = false ;
165- if (!this .isDebugMode ) {
165+ if (!this .isDebugMode || ! this . appVersion . equals ( packageAppVersion ) ) {
166166 this .clearUpdates ();
167167 }
168168
Original file line number Diff line number Diff line change @@ -100,10 +100,15 @@ + (NSURL *)bundleURLForResource:(NSString *)resourceName
100100 isRunningBinaryVersion = NO ;
101101 return packageUrl;
102102 } else {
103+ BOOL isRelease = NO ;
103104#ifndef DEBUG
104- [CodePush clearUpdates ] ;
105+ isRelease = YES ;
105106#endif
106107
108+ if (isRelease || ![binaryAppVersion isEqualToString: packageAppVersion]) {
109+ [CodePush clearUpdates ];
110+ }
111+
107112 NSLog (logMessageFormat, binaryBundleURL);
108113 isRunningBinaryVersion = YES ;
109114 return binaryBundleURL;
You can’t perform that action at this time.
0 commit comments