mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-22 15:36:10 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f2314d3c9 |
@@ -37,8 +37,14 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>For taking photos</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string></string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>For saving photos</string>
|
||||
<key>RCTNewArchEnabled</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
@@ -53,10 +59,5 @@
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>For taking photos</string>
|
||||
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>For saving photos</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable react/no-unstable-nested-components */
|
||||
/* eslint-disable react-native/no-inline-styles */
|
||||
import React, {useRef, useState} from 'react';
|
||||
import React, { useRef, useState } from 'react';
|
||||
import {
|
||||
StyleSheet,
|
||||
Platform,
|
||||
@@ -19,15 +19,14 @@ import {
|
||||
Modal,
|
||||
Portal,
|
||||
} from 'react-native-paper';
|
||||
import {Camera} from 'react-native-camera-kit';
|
||||
import {LocalSvg} from 'react-native-svg/css';
|
||||
|
||||
import { Camera } from 'react-native-camera-kit';
|
||||
import { LocalSvg } from 'react-native-svg/css';
|
||||
|
||||
import TestConsole from './TestConsole';
|
||||
|
||||
import _updateConfig from '../update.json';
|
||||
import {UpdateProvider, Pushy, Cresc, useUpdate} from 'react-native-update';
|
||||
const {appKey} = _updateConfig[Platform.OS];
|
||||
import { UpdateProvider, Pushy, Cresc, useUpdate } from 'react-native-update';
|
||||
const { appKey } = _updateConfig[Platform.OS];
|
||||
|
||||
function App() {
|
||||
const {
|
||||
@@ -54,8 +53,8 @@ function App() {
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.welcome}>欢迎使用Pushy热更新服务</Text>
|
||||
<View style={{flexDirection: 'row'}}>
|
||||
<Text style={styles.welcome}>欢迎22使用Pushy热更新服务</Text>
|
||||
<View style={{ flexDirection: 'row' }}>
|
||||
<Text>
|
||||
{useDefaultAlert ? '当前使用' : '当前不使用'}默认的alert更新提示
|
||||
</Text>
|
||||
@@ -74,9 +73,9 @@ function App() {
|
||||
<Portal>
|
||||
<Modal visible={showCamera} onDismiss={() => setShowCamera(false)}>
|
||||
<Camera
|
||||
style={{minHeight: 320}}
|
||||
style={{ minHeight: 320 }}
|
||||
scanBarcode={true}
|
||||
onReadCode={({nativeEvent: {codeStringValue}}) => {
|
||||
onReadCode={({ nativeEvent: { codeStringValue } }) => {
|
||||
// 防止重复扫码
|
||||
if (lastParsedCode.current === codeStringValue) {
|
||||
return;
|
||||
@@ -94,7 +93,7 @@ function App() {
|
||||
/>
|
||||
</Modal>
|
||||
</Portal>
|
||||
<View style={{flexDirection: 'row', alignItems: 'center', gap: 10}}>
|
||||
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 10 }}>
|
||||
<Text>png:</Text>
|
||||
<Image
|
||||
resizeMode={'contain'}
|
||||
@@ -102,11 +101,11 @@ function App() {
|
||||
style={styles.image}
|
||||
/>
|
||||
</View>
|
||||
<View style={{flexDirection: 'row', alignItems: 'center', gap: 10}}>
|
||||
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 10 }}>
|
||||
<Text>svg:</Text>
|
||||
<LocalSvg
|
||||
asset={require('./assets/react-logo.svg')}
|
||||
style={{width: 30, height: 30}}
|
||||
style={{ width: 30, height: 30 }}
|
||||
/>
|
||||
</View>
|
||||
<Text style={styles.instructions}>
|
||||
@@ -124,16 +123,18 @@ function App() {
|
||||
onPress={() => {
|
||||
checkUpdate();
|
||||
setShowUpdateSnackbar(true);
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
<Text style={styles.instructions}>点击这里检查更新</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
<TouchableOpacity
|
||||
testID="testcase"
|
||||
style={{marginTop: 15}}
|
||||
style={{ marginTop: 15 }}
|
||||
onLongPress={() => {
|
||||
setShowTestConsole(true);
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
<Text style={styles.instructions}>
|
||||
react-native-update版本:{client?.version}
|
||||
</Text>
|
||||
@@ -155,14 +156,15 @@ function App() {
|
||||
await downloadUpdate();
|
||||
setShowUpdateBanner(true);
|
||||
},
|
||||
}}>
|
||||
<Text style={{color: 'white'}}>
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: 'white' }}>
|
||||
有新版本({updateInfo.name})可用,是否更新?
|
||||
</Text>
|
||||
</Snackbar>
|
||||
)}
|
||||
<Banner
|
||||
style={{width: '100%', position: 'absolute', top: 0}}
|
||||
style={{ width: '100%', position: 'absolute', top: 0 }}
|
||||
visible={showUpdateBanner}
|
||||
actions={[
|
||||
{
|
||||
@@ -177,9 +179,10 @@ function App() {
|
||||
},
|
||||
},
|
||||
]}
|
||||
icon={({size}) => (
|
||||
icon={({ size }) => (
|
||||
<Icon name="checkcircleo" size={size} color="#00f" />
|
||||
)}>
|
||||
)}
|
||||
>
|
||||
更新已完成,是否立即重启?
|
||||
</Banner>
|
||||
</View>
|
||||
@@ -227,4 +230,4 @@ export default function Root() {
|
||||
</PaperProvider>
|
||||
</UpdateProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ RCT_EXPORT_MODULE(RCTPushy);
|
||||
NSDictionary *pushyInfo = [defaults dictionaryForKey:keyPushyInfo];
|
||||
NSString *currentVersion = [pushyInfo objectForKey:paramCurrentVersion];
|
||||
ret[@"currentVersion"] = currentVersion;
|
||||
ret[@"currentVersionInfo"] = [pushyInfo objectForKey:[keyHashInfo stringByAppendingString:currentVersion]];
|
||||
ret[@"currentVersionInfo"] = [defaults objectForKey:[keyHashInfo stringByAppendingString:currentVersion]];
|
||||
|
||||
// clear isFirstTimemarked
|
||||
if (ret[@"isFirstTime"]) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-update",
|
||||
"version": "10.31.0",
|
||||
"version": "10.31.1",
|
||||
"description": "react-native hot update",
|
||||
"main": "src/index",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user