mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-05-14 02:14:52 +08:00
Merge pull request #225 from Microsoft/remove-semver-use
Remove semver use
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { AcquisitionManager as Sdk } from "code-push/script/acquisition-sdk";
|
||||
import { Alert } from "./AlertAdapter";
|
||||
import requestFetchAdapter from "./request-fetch-adapter";
|
||||
import semver from "semver";
|
||||
import { Platform } from "react-native";
|
||||
|
||||
let NativeCodePush = require("react-native").NativeModules.CodePush;
|
||||
@@ -41,7 +40,7 @@ async function checkForUpdate(deploymentKey = null) {
|
||||
* in any updates for current app store version, regardless of hash.
|
||||
*/
|
||||
let queryPackage;
|
||||
if (localPackage && localPackage.appVersion && semver.compare(localPackage.appVersion, config.appVersion) === 0) {
|
||||
if (localPackage) {
|
||||
queryPackage = localPackage;
|
||||
} else {
|
||||
queryPackage = { appVersion: config.appVersion };
|
||||
|
||||
@@ -193,7 +193,7 @@ To let the CodePush runtime know which deployment it should query for updates ag
|
||||
|
||||

|
||||
|
||||
2. In your app's `Info.plist` make sure your `Bundle versions string, short` (aka `CFBundleShortVersionString`) value is a valid [semver](http://semver.org/) version (e.g. 1.0.0 not 1.0)
|
||||
2. In your app's `Info.plist` make sure your `Bundle versions string, short` (aka `CFBundleShortVersionString`) value is a valid [semver](http://semver.org/) version. Note that if the value provided is missing a patch version, the CodePush server will assume it is `0`, i.e. `1.0` will be treated as `1.0.0`.
|
||||
|
||||

|
||||
|
||||
@@ -269,7 +269,7 @@ After installing the plugin and syncing your Android Studio project with Gradle,
|
||||
}
|
||||
```
|
||||
|
||||
2. Ensure that the `android.defaultConfig.versionName` property in your `android/app/build.gradle` file is set to a semver compliant value (i.e. "1.0.0" not "1.0")
|
||||
2. Ensure that the `android.defaultConfig.versionName` property in your `android/app/build.gradle` file is set to a semver compliant value. Note that if the value provided is missing a patch version, the CodePush server will assume it is `0`, i.e. `1.0` will be treated as `1.0.0`.
|
||||
|
||||
```gradle
|
||||
android {
|
||||
@@ -325,7 +325,7 @@ After installing the plugin and syncing your Android Studio project with Gradle,
|
||||
}
|
||||
```
|
||||
|
||||
2. Ensure that the `android.defaultConfig.versionName` property in your `android/app/build.gradle` file is set to a semver compliant value (i.e. "1.0.0" not "1.0")
|
||||
2. Ensure that the `android.defaultConfig.versionName` property in your `android/app/build.gradle` file is set to a semver compliant value. Note that if the value provided is missing a patch version, the CodePush server will assume it is `0`, i.e. `1.0` will be treated as `1.0.0`.
|
||||
|
||||
```gradle
|
||||
android {
|
||||
|
||||
@@ -162,7 +162,7 @@ public class CodePush {
|
||||
} else {
|
||||
// The binary version is newer.
|
||||
didUpdate = false;
|
||||
if (!this.isDebugMode) {
|
||||
if (!this.isDebugMode || !this.appVersion.equals(packageAppVersion)) {
|
||||
this.clearUpdates();
|
||||
}
|
||||
|
||||
|
||||
@@ -103,10 +103,15 @@ static NSString *bundleResourceName = @"main";
|
||||
isRunningBinaryVersion = NO;
|
||||
return packageUrl;
|
||||
} else {
|
||||
BOOL isRelease = NO;
|
||||
#ifndef DEBUG
|
||||
[CodePush clearUpdates];
|
||||
isRelease = YES;
|
||||
#endif
|
||||
|
||||
if (isRelease || ![binaryAppVersion isEqualToString:packageAppVersion]) {
|
||||
[CodePush clearUpdates];
|
||||
}
|
||||
|
||||
NSLog(logMessageFormat, binaryBundleURL);
|
||||
isRunningBinaryVersion = YES;
|
||||
return binaryBundleURL;
|
||||
|
||||
@@ -16,10 +16,9 @@
|
||||
"url": "https://github.com/Microsoft/react-native-code-push"
|
||||
},
|
||||
"dependencies": {
|
||||
"code-push": "1.5.2-beta",
|
||||
"semver": "^5.1.0"
|
||||
"code-push": "1.5.2-beta"
|
||||
},
|
||||
"devDependencies": {
|
||||
"react-native": "0.19.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user