Manage APK Prompt Installation
Overview
Receive download
Receive the broadcast, action:android.intent.action.TMS_DOWNLOADED extra value name: apk_notify_info type: JSONArray, for example: [{"appId":19068,"newVersion":1,"newVersionName":"1.0","packageName":"com.liqi.myapp20210324"}] <receiver
android:name=".receiver.ApkDownloadedReceiver">
<intent-filter>
<action android:name="android.intent.action.TMS_DOWNLOADED" />
</intent-filter>
</receiver> String apk_notify_info = intent.getStringExtra("apk_notify_info");Notice to install
Send broadcast to install, action: android.intent.action.TMS_INSTALL extra value name: apk_start_install_notify_info type: JSONArray, for example: [{"appId":19068,"newVersion":1,"newVersionName":"1.0","packageName":"com.liqi.myapp20210324"}] Intent intent = new Intent();
intent.putExtra("apk_start_install_notify_info", JSON.toJSONString(apkNotifyInfos));
intent.setAction("android.intent.action.TMS_INSTALL");
context.sendBroadcast(intent);ApkNotifyInfo class
Considerations
Last updated