3
votes

I want to find whether a particular app is installed on device and retrieve the version number of that app. How can i do this in Xamarin forms? I need to implement this in both Android and iOS.

1
Not possible, at least not on iOS.Gerald Versluis
You need to create the DependencyService in xamarin forms to get the app version of both android and iOSDinesh Phalwadiya
Not possible on iOS, for Android there are plenty of existing examples on SO and blogs on how to do thisSushiHangover

1 Answers

6
votes

iOS:

Version:

Retrieving the version number of other app in iOS is impossible.

Is installed:

But, if you know the URL Scheme of a third party app, you can use canOpenURL(_:) to check if that app is installed on the device. If it returns true, it means the app is installed.

For example, you can check if Microsoft Outlook app is installed on the iOS device via the link ms-outlook:// by using the following code snippet:

if(UIApplication.SharedApplication.CanOpenUrl(new NSUrl(new NSString("ms-outlook://"))))
{
   //YOUR CODE...
}

Notice that, if it is in iOS 9 or above, you have to add the LSApplicationQueriesSchemes in the info.plist to allow the url scheme, like this:

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>ms-outlook</string>
</array>

Android:

In Android, you can use PackageManager and PackageInfo to check if any app is installed and the version of it.

There're some related SO cases you can refer to: