在调试设备上测试时显示 UPDATE_NOT_AVAILABLE 的应用内更新 API [英] In-App Update API showing UPDATE_NOT_AVAILABLE while testing on debugging device

查看:26
本文介绍了在调试设备上测试时显示 UPDATE_NOT_AVAILABLE 的应用内更新 API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试集成新的应用内更新 API,但我无法测试它的实现.似乎我的代码很好,因此我阅读了 Troubleshoots并且无法理解本文档中的 2 点

<块引用>

确保您正在测试的应用使用与 Google Play 中可用的签名密钥相同的签名密钥进行签名.

  1. 在已连接的设备上安装 Apk 时,如何在调试模式下使用相同的签名密钥进行签名?

<块引用>

如果您正在测试的应用没有出现可用更新,检查您是否正确设置了测试轨道.

  1. 是否必须在内部测试轨道中发布应用以测试实施?

无论如何,我只想在我的设备上进行测试,我从 Play 商店版本中减少了版本代码,但它始终显示 UPDATE_NOT_AVAILABLE.

这是代码:-

val appUpdateInfo: Task= appUpdateManager.appUpdateInfoappUpdateInfo.addOnSuccessListener {if (it.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE && it.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) {appUpdateManager.startUpdateFlowForResult(it, AppUpdateType.FLEXIBLE, this, 2);}别的{吐司(不可用")}}

解决方案

在再次彻底阅读文档之前,我为同样的问题苦苦挣扎了几天.在应用内的官方文档中阅读本节更新.

该链接描述了正确的测试程序如下:

<块引用>

  1. 在您的测试设备上,确保您已经安装了满足以下要求的应用版本:

  • 该应用是使用内部应用共享 URL 安装的
  • 支持应用内更新
  • 使用低于应用更新版本的版本代码
<块引用>

  1. 按照 Play 管理中心的说明操作,了解如何在内部共享您的应用.确保您上传的应用版本使用的版本代码高于您已在测试设备上安装的版本代码.
  2. 在测试设备上,只需点击应用更新版本的内部应用共享链接.请勿从点击链接后看到的 Google Play 商店页面安装该应用.
  3. 从设备的应用程序抽屉或主屏幕打开应用程序.该更新现在应该可用于您的应用,您可以测试应用内更新的实施.

这也非常有用,因为您不必等待应用发布,您可以立即开始测试.

I am trying to integrate the new In-App Update API but I cannot able to test it's implementation. Seems like my code is fine therefore I read the Troubleshoots and am not able to understand 2 points in this document

Make sure that the app that you are testing is signed with the same signing key as the one available from Google Play.

  1. How can I sign with same signing key in debug mode while installing Apk on Connected device?.

If the app you are testing doesn’t appear with an available update, check that you’ve properly set up your testing tracks.

  1. Is it compulsory to release App in internal testing tracks to test implementation?

Anyway I just want to test on my device and I decremented the version code from the play store version but its showing always UPDATE_NOT_AVAILABLE.

Here is code:-

val appUpdateInfo: Task<AppUpdateInfo> = appUpdateManager.appUpdateInfo
appUpdateInfo.addOnSuccessListener {
    if (it.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE && it.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) {
        appUpdateManager.startUpdateFlowForResult(it, AppUpdateType.FLEXIBLE, this, 2);
    }else{
        toast("Not Available")
    }
}

解决方案

I struggled with this same problem for a few days before once again going through the documentation thoroughly. Read this section on the official documentation of the in-app updates.

The link describes the correct testing procedure as follows:

  1. On your test device, make sure you've already installed a version of your app that meets the following requirements:

  • The app was installed using an internal app sharing URL
  • Supports in-app updates
  • Uses a version code that's lower than the updated version of your app

  1. Follow the Play Console instructions on how to share your app internally. Make sure you upload a version of your app that uses a version code that's higher than the one you have already installed on the test device.
  2. On the test device, only click the internal app-sharing link for the updated version of your app. Do not install the app from the Google Play Store page you see after clicking the link.
  3. Open the app from the device's app drawer or home screen. The update should now be available to your app, and you can test your implementation of in-app updates.

This is also super helpful because you don't have to wait for the app to be published, you can start testing immediately.

这篇关于在调试设备上测试时显示 UPDATE_NOT_AVAILABLE 的应用内更新 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆