小编Ser*_*yan的帖子

Android 应用内更新,我应该在哪里设置更新类型?

我可以从哪里设置应用更新类型(即时/灵活)?我在 Playstore 控制台中找不到它。

这个代码从哪里知道可用的更新类型?

 // Creates an instance of the manager.
AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(context);

// Returns an intent object that you use to check for an update.
Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();

// Checks that the platform will allow the specified type of update.
appUpdateInfoTask.addOnSuccessListener(appUpdateInfo -> {
    if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE
          // For a flexible update, use AppUpdateType.FLEXIBLE
          && appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)) {
              // Request the update.
    }
});
Run Code Online (Sandbox Code Playgroud)

java android kotlin

5
推荐指数
1
解决办法
701
查看次数

标签 统计

android ×1

java ×1

kotlin ×1