-1

My app is available for both Android and iOS users.

I want to do this:

I want to show version number of the app installed on mobile devices (Android phone or iPhone) and if a more recent version of the app is available on Google Play or Apple App Store then I want to show the version that is now available on app stores so that the user are aware that they are using a older version and decide whether they want to update the app they use. (I want to do this because I want to disable certain features of the app if the users are using a older version and I want to disable certain features of the app installed on the mobile devices based on the version number of the version of the app available on Google Play store or Apple App Store)

  • Does this answer your question? [Check if my app has a new version on AppStore](https://stackoverflow.com/questions/6256748/check-if-my-app-has-a-new-version-on-appstore) – lazarevzubov May 05 '22 at 06:32
  • What I want is not just finding out whether a new update is available but also what the version number of the next version now available on the app store (Google play store or Apple app store). I want the version number because it is based on the version number (of the new update) that I would disable certain features in the older version app installed on mobile device. – Mashup Transmitter May 05 '22 at 06:39
  • Have you checked answers there or just read the question title? Answers are based on comparing local version with the App Store version. As for Android, I think you have an answer below. – lazarevzubov May 05 '22 at 06:47

2 Answers2

1

I do not understand what exactly you want to achieve but I think AppUpdateManager is what you are looking for : https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateManager

  • I am developing a health app and I want the users to enter parameters such as blood sugar levels, blood pressure, oxygen level, etc. periodically to the mobile app and the mobile app would say something about their health. But if a new version of the app is available on the app store which uses a better algorithm to determine healthiness of the users then I want to disable using certain parts of the app (but I will allow viewing the previously entered figures - just to let users look at their historical data) and then ask the users to update the app first before determining their healthiness. – Mashup Transmitter May 05 '22 at 06:57
-1

Here you can find the current version of ios(swift)app. So you can use some pop that this is current version you are using .

Then you can compare current version of app and latest appstore version.If its true then there is no need to update and if its false then you need to update.

class var applicationBuildNumber: String { if let build = NSBundle.mainBundle().infoDictionary?["CFBundleVersion"] as? String { return build } return "Empty Build no" }

}

  • I don't think it's what was asked. The question is how to get the latest App Store version, not the locally installed one. – lazarevzubov May 05 '22 at 06:30
  • The question is about to retrieve the last version available on the App Store. Not in the info.plist. – Medhi May 06 '22 at 15:34