Problems with SDK 37 Updates API change

I just transitioned to SDK 37 and the Managed Workflow, and I’m having trouble with in-app updates (this is a multi-user app on a tablet that doesn’t get restarted often, so I check for updates when a user logs out).

Previously this worked:

    import { Updates } from 'expo';

    async checkForUpdate() {
        const update = await Updates.checkForUpdateAsync();
        if (update.isAvailable) {
            this.updateApp();
        }
    }
    async updateApp() {
        await Updates.fetchUpdateAsync();
        Updates.reloadFromCache();
    }

I rewrote this as:

import * as Updates from 'expo-updates';

    async checkForUpdate() {
        const update = await Updates.checkForUpdateAsync();
        if (update.isAvailable) {
            this.updateApp();
        }
    }
    async updateApp() {
        await Updates.fetchUpdateAsync();
        Updates.reloadAsync();
    }

I haven’t gone deep into debugging, but the checkForUpdateAsync() promise never seems to resolve, so my loading animation just stops midstream and needs to be manually aborted.

Thanks.

Adb logcat showed me the promise was being rejected with this error message: [Error: The method or property Updates.checkForUpdateAsync is not available on android, are you sure you’ve linked all the native dependencies properly?]

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.