In App update not working for app bundle apk

前端 未结 2 1533
旧时难觅i
旧时难觅i 2021-01-05 10:22

I have implemented recently launched In-App update API in my android app. When I build apk and test this functionality it works fine. ( I have uploaded apk with higher versi

2条回答
  •  北海茫月
    2021-01-05 11:11

    In app update works only if you have uploaded app-bundle to production track on play store. As mentioned by Serge Beauchamp, it will not work for internal app sharing. During my last production release, I have uploaded app-bundle instead of apk. Initially I could not see in-app update dialog may be for first 1-2 hours. But when I tried again on next day, I could see in-app update dialog. My suggestion is if your release is mandatory, implement fallback mechanism for update. In case play store refuses to show in-app update available, show your own dialog where you can redirect user to play-store to update app. You can use below code for fallback mechanism

        if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE && appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE))  {
         //play store says update available. In App update dialog will be displayed
    } else {
        //its mandatory release but play store says no update available ,
        // show custom UI to redirect to play store
    }
    

提交回复
热议问题