In my app I have a link. When clicking on the link, I want to send the user to Google Play and update the app automatically.
I tried this:
// package name from menifest: com.infibond.infi
public void installInfiApplication(View view){
final String apkurl = "market://details?id=" + "com.infibond.infi";
final Uri marketUri = Uri.parse(apkurl);
Intent promptInstall = new Intent(Intent.ACTION_VIEW).setData(marketUri);
startActivity(promptInstall);
}
But this sent the user to the store without updating the app.
Is there a way to do it? If yes then what is it?
Google does not currently provide a way to automatically start updating an app through an Intent. It seems unlikely that they ever will since it takes control of app installations away from users. Users can however enable auto updates for your app to get updates as soon as they are available unless the update requires new permissions (pre Android Marshmallow).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With