Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check programmatically if an App is installed?

I am developing an iPhone application which will install few third party applications in an enterprise. I have the information about the bundle IDs. Is there a way to check if the application is already installed, using some system APIs? Currently the application gets installed again, overwriting the current installation. I need to prevent this some how. (Apple's AppStore application disables the installation option if the app is already installed.)

like image 907
attisof Avatar asked Aug 18 '10 12:08

attisof


People also ask

How do I know if an app is installed?

Step 1: Open https://play.google.com/store in your web browser. Step 2: Type the name of the app in the search bar to look for the app.

How do you check if app is installed or not in Android programmatically?

Call the method isPackageInstalled() : boolean isAppInstalled = isPackageInstalled("com. android. app" , this.

Is app installed Appium?

Use isApplicationInstalled() method in Appium or application:find Perfecto command in RWD to determine if your application is installed. To check if an application is currently installed on the device, use the isApplicationInstalled method.


1 Answers

I think this is not possible directly, but if the apps register uri schemes you could test for that.

A URI scheme is for example fb:// for the facebook app. You can register that in the info.plist of your app. [UIApplication canOpenURL:url] will tell you if a certain url will or will not open. So testing if fb:// will open, will indicate that there is an app installed which registered fb:// - which is a good hint for the facebook app.

// check whether facebook is (likely to be) installed or not if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]]) {     // Safe to launch the facebook app     [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"fb://profile/200538917420"]]; } 
like image 200
mvds Avatar answered Sep 18 '22 11:09

mvds