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.
Asked
Active
Viewed 3,410 times
3
-
Not possible, at least not on iOS. – Gerald Versluis Nov 28 '17 at 11:21
-
You need to create the **DependencyService** in xamarin forms to get the app version of both android and iOS – Dinesh Falwadiya Nov 28 '17 at 12:17
-
Not possible on iOS, for Android there are plenty of existing examples on SO and blogs on how to do this – SushiHangover Nov 28 '17 at 12:39
1 Answers
6
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:

Kevin Li
- 2,258
- 1
- 9
- 18
-
-
@Cin If my answer is helpful, can you accept it, like this: https://meta.stackexchange.com/a/5235? It's important to me!Thanks. – Kevin Li Nov 30 '17 at 05:56