@cloud-push/expo
Version:
[](https://www.npmjs.com/package/@cloud-push/cloud) [](https://www.npmjs.com/package/@cloud-p
19 lines (18 loc) • 960 B
JavaScript
import * as __WEBPACK_EXTERNAL_MODULE_expo_constants_611bdd33__ from "expo-constants";
import * as __WEBPACK_EXTERNAL_MODULE_expo_updates_a2668886__ from "expo-updates";
const getConfig = ()=>__WEBPACK_EXTERNAL_MODULE_expo_constants_611bdd33__.default.expoConfig?.extra?.cloudPush ?? {};
async function getUpdateStatus() {
const config = getConfig();
if (!config.checkUpdateStatusUrl) throw new Error("Failed to load checkStatusUrl");
if (!__WEBPACK_EXTERNAL_MODULE_expo_updates_a2668886__.updateId) throw new Error('Failed to load updateId');
if (config.checkUpdateStatusUrl) {
const headers = new Headers();
headers.append("expo-current-update-id", __WEBPACK_EXTERNAL_MODULE_expo_updates_a2668886__.updateId);
const response = await fetch(config.checkUpdateStatusUrl, {
headers
});
const status = await response.json();
return status;
}
}
export { getConfig, getUpdateStatus };