Skip to content

Commit 6e4f432

Browse files
committed
fix
1 parent 1b4c039 commit 6e4f432

File tree

12 files changed

+343
-746
lines changed

12 files changed

+343
-746
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ harmony/package
5959
harmony/pushy/.preview
6060
Example/harmony_use_pushy/harmony/entry/src/main/resources/rawfile/meta.json
6161
**/.hvigor
62+
Example/harmony_use_pushy/harmony/entry/src/main/cpp/generated

Example/harmony_use_pushy/App.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
/* eslint-disable react/no-unstable-nested-components */
21
/* eslint-disable react-native/no-inline-styles */
32
import React, {useState} from 'react';
43
import {StyleSheet, Text, View, TouchableOpacity, Image} from 'react-native';
54

65
import TestConsole from './TestConsole';
76

87
import _updateConfig from './update.json';
9-
import {PushyProvider, Pushy, usePushy} from 'react-native-update';
8+
import {UpdateProvider, Pushy, useUpdate} from 'react-native-update';
109
const {appKey} = _updateConfig.harmony;
1110

1211
function App() {
@@ -20,7 +19,7 @@ function App() {
2019
packageVersion,
2120
currentHash,
2221
progress: {received, total} = {},
23-
} = usePushy();
22+
} = useUpdate();
2423
const [useDefaultAlert, setUseDefaultAlert] = useState(false);
2524
const [showTestConsole, setShowTestConsole] = useState(false);
2625
const [showUpdateBanner, setShowUpdateBanner] = useState(false);
@@ -41,6 +40,7 @@ function App() {
4140
return (
4241
<View style={styles.container}>
4342
<Text style={styles.welcome}>欢迎使用Pushy热更新服务</Text>
43+
{/* <Image source={require('./gmail.png')} style={styles.image} /> */}
4444
{/* <Text style={styles.welcome}>😁hdiffFromAPP更新成功!!!</Text> */}
4545
{/* <Text style={styles.welcome}>😁hdiffFromPPk更新成功!!!</Text> */}
4646
<View style={{flexDirection: 'row'}}>
@@ -166,7 +166,7 @@ function App() {
166166
style={{marginRight: 20}}>
167167
<Text style={{color: '#2196F3'}}>下次再说</Text>
168168
</TouchableOpacity>
169-
<TouchableOpacity onPress={switchVersion}>
169+
<TouchableOpacity onPress={() => switchVersion()}>
170170
<Text style={{color: '#2196F3'}}>立即重启</Text>
171171
</TouchableOpacity>
172172
</View>
@@ -204,18 +204,22 @@ const styles = StyleSheet.create({
204204
color: '#333333',
205205
marginBottom: 5,
206206
},
207-
image: {},
207+
image: {
208+
width: 109,
209+
height: 40,
210+
},
208211
});
209212

210213
const pushyClient = new Pushy({
211214
appKey,
212215
debug: true,
216+
updateStrategy: null,
213217
});
214218

215219
export default function Root() {
216220
return (
217-
<PushyProvider client={pushyClient}>
221+
<UpdateProvider client={pushyClient}>
218222
<App />
219-
</PushyProvider>
223+
</UpdateProvider>
220224
);
221225
}

Example/harmony_use_pushy/Gemfile

Lines changed: 0 additions & 6 deletions
This file was deleted.

Example/harmony_use_pushy/bun.lock

Lines changed: 323 additions & 203 deletions
Large diffs are not rendered by default.

Example/harmony_use_pushy/harmony/entry/src/main/cpp/generated/RNOHGeneratedPackage.h

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)