mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-10-31 13:23:12 +08:00 
			
		
		
		
	update example
This commit is contained in:
		| @@ -12,7 +12,7 @@ | |||||||
|         "react-native-paper": "^5.13.1", |         "react-native-paper": "^5.13.1", | ||||||
|         "react-native-safe-area-context": "^5.2.0", |         "react-native-safe-area-context": "^5.2.0", | ||||||
|         "react-native-svg": "^15.11.1", |         "react-native-svg": "^15.11.1", | ||||||
|         "react-native-update": "^10.23.0", |         "react-native-update": "^10.24.2", | ||||||
|         "react-native-vector-icons": "^10.2.0", |         "react-native-vector-icons": "^10.2.0", | ||||||
|       }, |       }, | ||||||
|       "devDependencies": { |       "devDependencies": { | ||||||
| @@ -1434,7 +1434,7 @@ | |||||||
|  |  | ||||||
|     "react-native-svg": ["react-native-svg@15.11.1", "", { "dependencies": { "css-select": "^5.1.0", "css-tree": "^1.1.3", "warn-once": "0.1.1" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-Qmwx/yJKt+AHUr4zjxx/Q69qwKtRfr1+uIfFMQoq3WFRhqU76aL9db1DyvPiY632DAsVGba1pHf92OZPkpjrdQ=="], |     "react-native-svg": ["react-native-svg@15.11.1", "", { "dependencies": { "css-select": "^5.1.0", "css-tree": "^1.1.3", "warn-once": "0.1.1" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-Qmwx/yJKt+AHUr4zjxx/Q69qwKtRfr1+uIfFMQoq3WFRhqU76aL9db1DyvPiY632DAsVGba1pHf92OZPkpjrdQ=="], | ||||||
|  |  | ||||||
|     "react-native-update": ["react-native-update@10.23.0", "", { "dependencies": { "nanoid": "^3.3.3", "react-native-url-polyfill": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-native": ">=0.59.0" } }, "sha512-gt6kL5Fd8iG46YYwvcuiD6Yod7DSzNZ/Qo5YuiAXrdO/h+3SCJsfDGVmSpanShwAepvvuAUELIJZIRpSrJdIvA=="], |     "react-native-update": ["react-native-update@10.24.2", "", { "dependencies": { "nanoid": "^3.3.3", "react-native-url-polyfill": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-native": ">=0.59.0" } }, "sha512-pMnAFWApyZkTFKJliENcKVl3wSjOH/e0mEaYjYodWjpmHGZVET/J/nZ46Q03/JRtXcVnYkaq//y3axMfgHC21g=="], | ||||||
|  |  | ||||||
|     "react-native-url-polyfill": ["react-native-url-polyfill@2.0.0", "", { "dependencies": { "whatwg-url-without-unicode": "8.0.0-3" }, "peerDependencies": { "react-native": "*" } }, "sha512-My330Do7/DvKnEvwQc0WdcBnFPploYKp9CYlefDXzIdEaA+PAhDYllkvGeEroEzvc4Kzzj2O4yVdz8v6fjRvhA=="], |     "react-native-url-polyfill": ["react-native-url-polyfill@2.0.0", "", { "dependencies": { "whatwg-url-without-unicode": "8.0.0-3" }, "peerDependencies": { "react-native": "*" } }, "sha512-My330Do7/DvKnEvwQc0WdcBnFPploYKp9CYlefDXzIdEaA+PAhDYllkvGeEroEzvc4Kzzj2O4yVdz8v6fjRvhA=="], | ||||||
|  |  | ||||||
|   | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -23,7 +23,7 @@ | |||||||
|     "react-native-paper": "^5.13.1", |     "react-native-paper": "^5.13.1", | ||||||
|     "react-native-safe-area-context": "^5.2.0", |     "react-native-safe-area-context": "^5.2.0", | ||||||
|     "react-native-svg": "^15.11.1", |     "react-native-svg": "^15.11.1", | ||||||
|     "react-native-update": "^10.23.0", |     "react-native-update": "^10.24.2", | ||||||
|     "react-native-vector-icons": "^10.2.0" |     "react-native-vector-icons": "^10.2.0" | ||||||
|   }, |   }, | ||||||
|   "devDependencies": { |   "devDependencies": { | ||||||
|   | |||||||
| @@ -25,7 +25,7 @@ import {LocalSvg} from 'react-native-svg/css'; | |||||||
| import TestConsole from './TestConsole'; | import TestConsole from './TestConsole'; | ||||||
|  |  | ||||||
| import _updateConfig from '../update.json'; | import _updateConfig from '../update.json'; | ||||||
| import {PushyProvider, Pushy, usePushy} from 'react-native-update'; | import {UpdateProvider, Pushy, Cresc, useUpdate} from 'react-native-update'; | ||||||
| const {appKey} = _updateConfig[Platform.OS]; | const {appKey} = _updateConfig[Platform.OS]; | ||||||
|  |  | ||||||
| function App() { | function App() { | ||||||
| @@ -40,7 +40,7 @@ function App() { | |||||||
|     currentHash, |     currentHash, | ||||||
|     parseTestQrCode, |     parseTestQrCode, | ||||||
|     progress: {received, total} = {}, |     progress: {received, total} = {}, | ||||||
|   } = usePushy(); |   } = useUpdate(); | ||||||
|   const [useDefaultAlert, setUseDefaultAlert] = useState(true); |   const [useDefaultAlert, setUseDefaultAlert] = useState(true); | ||||||
|   const [showTestConsole, setShowTestConsole] = useState(false); |   const [showTestConsole, setShowTestConsole] = useState(false); | ||||||
|   const [showUpdateBanner, setShowUpdateBanner] = useState(false); |   const [showUpdateBanner, setShowUpdateBanner] = useState(false); | ||||||
| @@ -203,17 +203,24 @@ const styles = StyleSheet.create({ | |||||||
|   image: {}, |   image: {}, | ||||||
| }); | }); | ||||||
|  |  | ||||||
| const pushyClient = new Pushy({ | // use Pushy for China users | ||||||
|  | // const updateClient = new Pushy({ | ||||||
|  | //   appKey, | ||||||
|  | //   debug: true, | ||||||
|  | // }); | ||||||
|  |  | ||||||
|  | // use Cresc for global users | ||||||
|  | const updateClient = new Cresc({ | ||||||
|   appKey, |   appKey, | ||||||
|   debug: true, |   debug: true, | ||||||
| }); | }); | ||||||
|  |  | ||||||
| export default function Root() { | export default function Root() { | ||||||
|   return ( |   return ( | ||||||
|     <PushyProvider client={pushyClient}> |     <UpdateProvider client={updateClient}> | ||||||
|       <PaperProvider> |       <PaperProvider> | ||||||
|         <App /> |         <App /> | ||||||
|       </PaperProvider> |       </PaperProvider> | ||||||
|     </PushyProvider> |     </UpdateProvider> | ||||||
|   ); |   ); | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 sunnylqm
					sunnylqm