Skip to content

Commit

Permalink
[expo] fix OTA update on Android
Browse files Browse the repository at this point in the history
**Summary**

- trying to fix.
- fix google-services.json to configure AppCheck properly, which cannot be done by OTA.

**Test**

- N/A

**Issue**

- N/A
  • Loading branch information
yssk22 committed Dec 29, 2024
1 parent 280cbfc commit a80eaa7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion expo/config/prod/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = (config) => {
// those id can be easily found in the URL in the browser in development buildsecrets.json
config.extra.hpapp.firebaseIOSClientID = '265427540400-um42nfj6a2d2i59u7j01pmgpijmqk1oc.apps.googleusercontent.com';
config.extra.hpapp.firebaseAndroidClientID =
'265427540400-k0bpqfj2fph4vf2sspqd5a85te6lh151.apps.googleusercontent.com';
'265427540400-e5jjgjmvm0ar0cnqn20lf27ncpj68jst.apps.googleusercontent.com';
config.updates.url = 'https://u.expo.dev/a76e7e46-e508-43cf-93a8-1ae32871d4f7';
return config;
};
6 changes: 4 additions & 2 deletions expo/features/app/internals/AppUpdateBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { t } from '@hpapp/system/i18n';
import Constants from 'expo-constants';
import * as Updates from 'expo-updates';
import { useState, useEffect } from 'react';
import { AppState, AppStateStatus, TouchableOpacity, StyleSheet, View, Dimensions } from 'react-native';
import { Alert, AppState, AppStateStatus, TouchableOpacity, StyleSheet, View, Dimensions } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import * as logging from 'system/logging';

Expand Down Expand Up @@ -89,10 +89,12 @@ export default function AppUpdateBanner() {
isUpdating: true
});
try {
Alert.alert('fetchUpdateAsync');
await Updates.fetchUpdateAsync();
Alert.alert('reloadAsync');
await Updates.reloadAsync();
} catch (e) {
alert(e?.toString() ?? 'Unknown error occurrs');
Alert.alert(e?.toString() ?? 'Unknown error occurrs');
setState({
...state,
isUpdating: false
Expand Down

0 comments on commit a80eaa7

Please sign in to comment.