diff --git a/Example/testHotUpdate/src/TestConsole.js b/Example/testHotUpdate/src/TestConsole.js
new file mode 100644
index 0000000..b3a2337
--- /dev/null
+++ b/Example/testHotUpdate/src/TestConsole.js
@@ -0,0 +1,73 @@
+import React from 'react';
+import {
+ ActivityIndicator,
+ Alert,
+ Modal,
+ TextInput,
+ Button,
+ NativeModules,
+ StyleSheet,
+ SafeAreaView,
+ Text,
+ View,
+} from 'react-native';
+
+const Pushy = NativeModules.Pushy;
+export default function TestConsole({visible}) {
+ const [text, setText] = React.useState('');
+ const [running, setRunning] = React.useState(false);
+ return (
+
+
+ 调试Pushy方法(方法名,参数,值换行)
+
+ {running && }
+
+
+
+
+
+ );
+}
diff --git a/Example/testHotUpdate/src/index.js b/Example/testHotUpdate/src/index.js
index f48d091..e50b1ca 100644
--- a/Example/testHotUpdate/src/index.js
+++ b/Example/testHotUpdate/src/index.js
@@ -8,7 +8,6 @@ import {
TouchableOpacity,
Linking,
Image,
- NativeModules,
} from 'react-native';
import {
@@ -25,12 +24,15 @@ import {
cInfo,
} from 'react-native-update';
+import TestConsole from './TestConsole';
+
import _updateConfig from '../update.json';
const {appKey} = _updateConfig[Platform.OS];
export default class App extends Component {
state = {
received: 0,
total: 0,
+ showTestConsole: false,
};
componentDidMount() {
if (isRolledBack) {
@@ -56,7 +58,7 @@ export default class App extends Component {
);
}
}
- doUpdate = async (info) => {
+ doUpdate = async info => {
try {
const hash = await downloadUpdate(info, {
onDownloadProgress: ({received, total}) => {
@@ -141,7 +143,7 @@ export default class App extends Component {
};
render() {
- const {received, total} = this.state;
+ const {received, total, showTestConsole} = this.state;
return (
欢迎使用热更新服务
@@ -167,12 +169,13 @@ export default class App extends Component {
{
- // TODO 调试pushy方法
+ this.setState({showTestConsole: true});
}}>
react-native-update版本:{cInfo.pushy}
+
{/* */}
);