How to use the rn-update-apk.getApps function in rn-update-apk

To help you get started, we’ve selected a few rn-update-apk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mikehardy / react-native-update-apk / example / App.js View on Github external
console.log("SSL Provider patch failed", rej);
        let message = "Old Android API, and SSL Provider could not be patched.";
        if (rej.message.includes("repairable")) {

          // In this particular case the user may even be able to fix it with a Google Play Services update
          message +=
            " This is repairable on this device though." +
            " You should send the users to the Play Store to update Play Services...";
          Alert.alert("Possible SSL Problem", message);
          UpdateAPK.patchSSLProvider(false, true); // This will ask Google Play Services to help the user repair
        } else {
          Alert.alert("Possible SSL Problem", message);
        }
      });

      UpdateAPK.getApps().then(apps => {
        console.log("Installed Apps: ", JSON.stringify(apps));
        this.setState({ allApps: apps});
      }).catch(e => console.log("Unable to getApps?", e));

      UpdateAPK.getNonSystemApps().then(apps => {
        console.log("Installed Non-System Apps: ", JSON.stringify(apps));
        this.setState({ allNonSystemApps: apps});
      }).catch(e => console.log("Unable to getNonSystemApps?", e));
    }