Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/100.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 应用内更新-startUpdateFlowForResult未触发更新对话框_Android_In App Update - Fatal编程技术网

Android 应用内更新-startUpdateFlowForResult未触发更新对话框

Android 应用内更新-startUpdateFlowForResult未触发更新对话框,android,in-app-update,Android,In App Update,我正在使用fakeUpdateManager测试应用程序内更新对话框,我已将updateAvailable设置为10-10是我在playstore上拥有的版本代码,我正在构建版本代码为9的内置应用程序(发行版) 该应用程序正在商店进行内部测试 fakeUpdateManager=FakeAppUpdateManager(此) fakeUpdateManager?.setUpdateAvailable(10) 以下代码用于侦听下载完成等,但由于updateFlow尚未启动,因此没有任何用处: v

我正在使用fakeUpdateManager测试应用程序内更新对话框,我已将updateAvailable设置为10-10是我在playstore上拥有的版本代码,我正在构建版本代码为9的内置应用程序(发行版)

该应用程序正在商店进行内部测试

fakeUpdateManager=FakeAppUpdateManager(此) fakeUpdateManager?.setUpdateAvailable(10)

以下代码用于侦听下载完成等,但由于updateFlow尚未启动,因此没有任何用处:

 var installStateUpdatedListener: InstallStateUpdatedListener =
    object : InstallStateUpdatedListener {
        override fun onStateUpdate(state: InstallState) {
            if (state.installStatus() == InstallStatus.DOWNLOADED) {
                popupSnackbarForCompleteUpdate()
            } else if (state.installStatus() == InstallStatus.INSTALLED) {
                if (fakeUpdateManager != null) {
                    fakeUpdateManager?.unregisterListener(this)
                }
            } else {
                Log.i(
                    "MainActivity",
                    "InstallStateUpdatedListener: state: " + state.installStatus()
                )
            }
        }
    }
在appUpdateInfo内部-获取以下值

appUpdateInfo : AppUpdateInfo{packageName=com.property.ility, availableVersionCode=10, updateAvailability=2, installStatus=0, clientVersionStalenessDays=-1, bytesDownloaded=0, totalBytesToDownload=0, immediateUpdateIntent=PendingIntent{3f8812d: android.os.BinderProxy@df8e662}, flexibleUpdateIntent=PendingIntent{af823f3: android.os.BinderProxy@df8e662}}
我选中了-
fakeUpdateManager?.isImmediateFlowVisible
它返回我
false

下面是FakeUpdateManager类提供的方法。文件说:

/**
 * Returns whether the user confirmation screen of the immediate update is visible to 
the user.
 */

public boolean isImmediateFlowVisible() { throw new RuntimeException("Stub!"); }

你找到解决办法了吗?我刚刚在我的项目中集成了google in-app update,并执行了google博客提供的测试步骤,但没有出现更新对话框。即使我尝试添加日志,但代码中也不会出现任何问题…你能帮我找出问题吗?实际上,更新对话框弹出窗口在第二天自动出现,我没有对代码做任何更改。
/**
 * Returns whether the user confirmation screen of the immediate update is visible to 
the user.
 */

public boolean isImmediateFlowVisible() { throw new RuntimeException("Stub!"); }