- expo: ^53.0.0 → ^54.0.0 (54.0.33) - react-native: 0.79.6 → 0.81.5 - react: 19.0.0 → 19.1.0 - babel-preset-expo: ~13.0.0 → ~54.0.10 - @expo/vector-icons: ^14.0.2 → ^15.0.3 - react-native-reanimated: ~3.17.4 → ~4.1.1 - react-native-worklets: 新規追加 (reanimated v4 必須 peer dep) - expo-system-ui: 新規追加 (userInterfaceStyle 対応) 変更内容: - app.json: newArchEnabled を expo-build-properties から expo root へ移動 - babel.config.js: React Compiler を明示的に無効化 - UpdateAsync.ts: expo-updates reloadAsync API 変更に対応 - TopMenuButton.tsx: @expo/vector-icons deep path import を named import に変更 - trainIconStatus.tsx: 未使用の Icon deep path import を削除 - package.json: @types/react ~19.0.10 → ~19.1.4、doctor exclude 追加
38 lines
983 B
TypeScript
38 lines
983 B
TypeScript
import { Platform, ToastAndroid } from "react-native";
|
|
import * as Updates from "expo-updates";
|
|
|
|
export const UpdateAsync = () => {
|
|
Updates.checkForUpdateAsync()
|
|
.then((update) => {
|
|
if (!update.isAvailable) return;
|
|
if (Platform.OS !== "android") {
|
|
alert("アプリのデータを更新しています。");
|
|
} else {
|
|
ToastAndroid.showWithGravityAndOffset(
|
|
"アプリのデータを更新しています。",
|
|
ToastAndroid.LONG,
|
|
ToastAndroid.BOTTOM,
|
|
25,
|
|
50
|
|
);
|
|
}
|
|
Updates.fetchUpdateAsync().then(() => Updates.reloadAsync());
|
|
return;
|
|
})
|
|
.catch((e) => {
|
|
Platform.OS != "android"
|
|
? alert(e.toString())
|
|
: ToastAndroid.showWithGravityAndOffset(
|
|
e.toString(),
|
|
ToastAndroid.LONG,
|
|
ToastAndroid.BOTTOM,
|
|
25,
|
|
50
|
|
);
|
|
return;
|
|
})
|
|
.finally(() => {
|
|
return;
|
|
});
|
|
};
|