Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to detect if user has an app in Cocoa

How can I detect if user has an app, like echofon or twitter for mac or if user has pages, or textmate? Any suggestions?

like image 200
rafa Avatar asked Oct 23 '11 13:10

rafa


People also ask

How do I know if an app is installed or not in Swift?

Finally, call navigator. getInstalledRelatedApps() to check if your Android app is installed.


1 Answers

Use NSWorkspace's fullPathForApplication: to get an application's bundle path. If that method returns nil, the app is not installed. For example:

NSString *path = [[NSWorkspace sharedWorkspace] fullPathForApplication:@"Twitter"];

BOOL isTwitterInstalled = (nil != path);

URLForApplicationWithBundleIdentifier is another method you may use.

like image 118
Francis McGrew Avatar answered Oct 17 '22 16:10

Francis McGrew