IONIC 6 and Capacitor: If there's an app update, how can i navigate to the store? (Android/iOS)

I’m using Ionic 6 and Capacitor 4.0.1 with Angular. I’m trying to obligate my users to update the app if there’s a new app version on the store. But i can’t see any Native api or capacitor plugin for this… only things like ‘app rate’…

i’ve solved doing the following steps:

  1. store in my db the “current supported version” items

  2. in my app, i have a currente version variable

  3. I check if the current version is valid with a backend service

  4. If it isn’t a valid version it redirects the user to the app store with the Market plugin
    this.openAppStore();

import { Market } from '@ionic-native/market/ngx';
   ...

  openAppStore() {
    let id = this.myService.isPlatformAndroid ? 'com.myapp.xxx' : 'idxxxxxxx';
    this.market.open(id);
  }
3 Likes

There is an awesome plugin for this! Check it out: GitHub - capawesome-team/capacitor-app-update: ⚡️ Capacitor plugin that assists with app updates.

4 Likes

@EinfachHans i’m testing this option and i’m having problems with it. At the moment of publish a closed alpha of the app Google Play Store told me that i can’t use this cane of permission with any app.

Blockquote We have detected that your application’s manifest file contains the REQUEST_INSTALL_PACKAGES permission. Your app will be evaluated based on the policy of the Request Package Installation permission. We recommend that you fill out the declaration form available on the Play Console.
If your app doesn’t use the Request Install Packages permission for allowed features, or you’ve stopped using this permission, you should remove it from your app’s manifest. For more information, you can watch this PolicyBytes video.

I’m 100% sure it’s because the capacitor-app-update, but i can’t find any way to solve it.

@ciccilleju also same with the ionic-native-market API… it’s something new from google since 29 septembre policy…

check you android manifest, it depends on REQUEST_INSTALL_PACKAGES and not on the plugin itself.

For what are you using REQUEST_INSTALL_PACKAGES?

it was autogenerated after being installed any of this plugins. I tried to delete that permission from Android project, but Google reject it anyways.

i’m pretty sure it’s not the market plugin. What are the other plugins you installed?

Solved. It was another native plugin from ionic, which have used the permission… thx for the attention and the quick answer!

1 Like

Very usefull plugin thanks !