Is there a way to find out if an iPhone / iPad app is installed already?
I'm writing a freeware version of an app and would like to check if a user already has the unfree version installed, and print a message whose contents are conditional on the results of the installation check... anybody know if this is possible?
the closest I've come t开发者_开发技巧o a solution is to make use of the CFPreferencesSetValue API with a kCFPreferencesAnyUser / kCFPreferencesCurrentHost pairing... I haven't tried it, but based on the documentation it sounds possible.
however in my current specific situation this API will not be able to solve my problem, because I want to check for the presence of an app I wrote 4 months ago that didn't write any data to the CFPrefs registry... because back then I didn't know of it nor did I foresee this situation arising... the only way CFPrefs can assist me is in future apps now that I know it exists :)
so I'm wondering if there are other ways to do it? any help will be appreciated :)
You can register a custom URL scheme for your existing application and then call canOpenURL in your new application to detect if the application is installed.
According to this answer, if you have the same top level app id you can access your other app's data area. I believe wild-card app id's can also share data, see the provisioning portal docs.
You can share data between applications via the keychain. Write data in the full app and check from the free one or vice versa.
Hi i have been researching on this topic for a few months i found out this.
There is no authentic way to detect all apps installed in your device that is not jail broken. For doing it what i did was, I used this statement.
if( [[UIApplication SharedApplication] canOpenURL:(the apps scheme)] )
{
NSLog(@"App found");
}
You can find a list of schemes in the below sites.
This one has a json api too.
http://schemes.zwapp.com/
http://schemes.zwapp.com/.json?page=1 to http://schemes.zwapp.com/.json?page=470 incrementally.
This one has very famous app schemes and example of usage too
http://handleopenurl.com/
The better way to look into it
https://github.com/danielamitay/iHasApp
Sorry, no, there is no way for an app to find out information about any other app installed in an iPhone (without jailbreaking). Apple intentionally sandboxes the apps so they are completely isolated.
The best possible thing you could do (in the future) is register a URL handler that would launch your other app, and in turn would re-launch your current app with a parameter.
-dan
精彩评论