Facebook
From Obese Mosquito, 1 Month ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 58
  1. try {
  2.     const update = await Updates.checkForUpdateAsync();
  3.     if (update.isAvailable) {
  4.       await Updates.fetchUpdateAsync();
  5.       // ... notify user of update ...
  6.       Alert.alert(
  7.         "App Update",
  8.         "A New update is available and downloaded. Please realod app now.",
  9.         [
  10.           {
  11.             text: "Reload Now",
  12.             onPress: async () => {
  13.               await Updates.reloadAsync();
  14.             },
  15.           },
  16.         ],
  17.         { cancelable: false }
  18.       );
  19.     }
  20.   } catch (e) {
  21.     console.warn(e);
  22.   }