1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-11-03 23:03:11 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

feat: add getCurrentVersionInfo

This commit is contained in:
sunnylqm
2024-02-25 22:23:46 +08:00
parent ab9c40bf2e
commit 45bfa2560e
2 changed files with 15 additions and 3 deletions

View File

@@ -13,7 +13,12 @@ import {
Linking,
} from 'react-native';
import { Pushy } from './client';
import { currentVersion, isFirstTime, packageVersion } from './core';
import {
currentVersion,
isFirstTime,
packageVersion,
getCurrentVersionInfo,
} from './core';
import { CheckResult, ProgressData } from './type';
import { PushyContext } from './context';
@@ -88,9 +93,9 @@ export const PushyProvider = ({
}, [client, showAlert, updateInfo]);
const downloadAndInstallApk = useCallback(
(downloadUrl: string) => {
async (downloadUrl: string) => {
if (Platform.OS === 'android' && downloadUrl) {
client.downloadAndInstallApk(downloadUrl, setProgress);
await client.downloadAndInstallApk(downloadUrl, setProgress);
}
},
[client],
@@ -188,6 +193,7 @@ export const PushyProvider = ({
currentHash: currentVersion,
progress,
downloadAndInstallApk,
getCurrentVersionInfo,
}}
>
{children}