mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-10-31 13:23:12 +08:00 
			
		
		
		
	feat: new version
This commit is contained in:
		| @@ -8,15 +8,12 @@ import { | ||||
|   Image, | ||||
|   Switch, | ||||
| } from 'react-native'; | ||||
| import {Icon, PaperProvider} from 'react-native-paper'; | ||||
| import {Snackbar, Banner} from 'react-native-paper'; | ||||
| import {Icon, PaperProvider, Snackbar, Banner} from 'react-native-paper'; | ||||
|  | ||||
| import TestConsole from './TestConsole'; | ||||
|  | ||||
| import _updateConfig from '../update.json'; | ||||
| import {PushyProvider} from '../../../src/provider'; | ||||
| import {Pushy} from '../../../src/client'; | ||||
| import {usePushy} from '../../../src/context'; | ||||
| import {PushyProvider, Pushy, usePushy} from 'react-native-update'; | ||||
| const {appKey} = _updateConfig[Platform.OS]; | ||||
|  | ||||
| function App() { | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -2,7 +2,7 @@ | ||||
|   "name": "react-native-update", | ||||
|   "version": "9.1.6", | ||||
|   "description": "react-native hot update", | ||||
|   "main": "lib/index.ts", | ||||
|   "main": "src/index.ts", | ||||
|   "scripts": { | ||||
|     "prepublish": "yarn submodule", | ||||
|     "submodule": "git submodule update --init --recursive", | ||||
| @@ -39,6 +39,7 @@ | ||||
|     "url": "https://github.com/reactnativecn/react-native-pushy/issues" | ||||
|   }, | ||||
|   "peerDependencies": { | ||||
|     "react": ">=16.8.0", | ||||
|     "react-native": ">=0.57.0" | ||||
|   }, | ||||
|   "homepage": "https://github.com/reactnativecn/react-native-pushy#readme", | ||||
| @@ -59,8 +60,8 @@ | ||||
|     "@types/react": "^18.2.46", | ||||
|     "eslint": "^8.56.0", | ||||
|     "prettier": "^2", | ||||
|     "react": "18.2.0", | ||||
|     "react-native": "0.73", | ||||
|     "react": "18.0.0", | ||||
|     "react-native": "0.69.8", | ||||
|     "typescript": "^5.3.3", | ||||
|     "@types/fs-extra": "^9.0.13", | ||||
|     "@types/jest": "^29.2.1", | ||||
|   | ||||
| @@ -66,7 +66,7 @@ export const PushyProvider = ({ | ||||
|         return; | ||||
|       } | ||||
|       stateListener.current && stateListener.current.remove(); | ||||
|       showAlert('Download complete', 'Do you want to apply the update now?', [ | ||||
|       showAlert('提示', '下载完毕,是否立即更新?', [ | ||||
|         { | ||||
|           text: '下次再说', | ||||
|           style: 'cancel', | ||||
| @@ -84,7 +84,7 @@ export const PushyProvider = ({ | ||||
|       ]); | ||||
|     } catch (err) { | ||||
|       setLastError(err); | ||||
|       showAlert('Failed to update', err.message); | ||||
|       showAlert('更新失败', err.message); | ||||
|     } | ||||
|   }, [client, showAlert, updateInfo]); | ||||
|  | ||||
| @@ -94,16 +94,13 @@ export const PushyProvider = ({ | ||||
|       info = await client.checkUpdate(); | ||||
|     } catch (err) { | ||||
|       setLastError(err); | ||||
|       showAlert('Failed to check update', err.message); | ||||
|       showAlert('更新检查失败', err.message); | ||||
|       return; | ||||
|     } | ||||
|     setUpdateInfo(info); | ||||
|     if ('expired' in info) { | ||||
|       const { downloadUrl } = info; | ||||
|       showAlert( | ||||
|         'Major update', | ||||
|         'A full update is required to download and install to continue.', | ||||
|         [ | ||||
|       showAlert('提示', '您的应用版本已更新,点击更新下载安装新版本', [ | ||||
|         { | ||||
|           text: '更新', | ||||
|           onPress: () => { | ||||
| @@ -116,8 +113,7 @@ export const PushyProvider = ({ | ||||
|             } | ||||
|           }, | ||||
|         }, | ||||
|         ], | ||||
|       ); | ||||
|       ]); | ||||
|     } else if ('update' in info) { | ||||
|       showAlert( | ||||
|         '提示', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 sunnylqm
					sunnylqm