Skip to content

Commit

Permalink
关于界面增加手动获取更新按钮;
Browse files Browse the repository at this point in the history
  • Loading branch information
shuiRong committed Apr 21, 2019
1 parent 0ae5912 commit 77be101
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ android {
applicationId "com.gakki"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2
versionName '1.1.3' // appVersion 这样有点问题,code-push打包报错;还是先写死
versionCode 4
versionName '1.1.5' // appVersion 这样有点问题,code-push打包报错;还是先写死
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gakki",
"version": "1.1.3",
"version": "1.1.5",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
Expand Down
37 changes: 36 additions & 1 deletion src/pages/About.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import Icon from 'react-native-vector-icons/FontAwesome5'
import { themeData } from '../utils/color'
import mobx from '../utils/mobx'
import { observer } from 'mobx-react'
import { version } from '../utils/config'
import { version, deploymentKey } from '../utils/config'
import codePush from 'react-native-code-push'

let color = {}
@observer
Expand Down Expand Up @@ -178,6 +179,40 @@ export default class About extends Component {
开源协议
</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() =>
codePush.sync({
updateDialog: {
appendReleaseDescription: true,
descriptionPrefix: '更新内容:',
title: '更新',
mandatoryUpdateMessage: '',
mandatoryContinueButtonLabel: '更新'
},
mandatoryInstallMode: codePush.InstallMode.IMMEDIATE,
deploymentKey: deploymentKey
})
}
activeOpacity={0.5}
style={{
marginTop: 20,
borderColor: color.contrastColor,
borderRadius: 3,
borderWidth: 1,
padding: 5,
paddingLeft: 10,
paddingRight: 10
}}
>
<Text
style={{
fontSize: 17,
color: color.contrastColor
}}
>
检查更新
</Text>
</TouchableOpacity>
</View>
</View>
)
Expand Down

0 comments on commit 77be101

Please sign in to comment.