How to Determine If a User Has an iOS App Installed

How can I determine if a user has an iOS app installed?

If the application supports a custom url scheme you can check UIApplication -canOpenURL:. That will tell you only that an application able to open that url scheme is available, not necessarily which application that is. There's no publicly available mechanism to inspect what other apps a user has installed on their device.

If you control both apps you might also use a shared keychain or pasteboard to communicate between them in more detail.

Can you find out what apps the user has installed?

Not on a stock phone. Jailbroken maybe, but I have not played with the jailbroken side of things.

You could try to open an app via a URL scheme. Using Twitter as an example, one of its URL schemes is twitter://user?screen_name=somename

You can check if you can open that URL:

NSURL *tURL = [NSURL URLWithString:@"twitter://user?screen_name=somename"];
if ( [[UIApplication sharedApplication] canOpenURL:tURL] )
// if here, you can open twitter app

You can extrapolate from here if you want.

Can i check what iOS apps a user has installed and what in app purchases?

Checking for Apps - Kind of.

For your own apps, you can use a Custom URL scheme to check if App1 is installed from within App2. Some major apps (like Facebook, YouTube, etc) also have this functionality, so you can see if those apps are installed, too.

But if you're looking for an app that doesn't support this system, you're out of luck.

Checking for In-App Purchases - No

As for checking whether a user has made an in-app purchase within another app, no, that information isn't available.

The only exception would be if you made both apps, and you store a record of the purchase on your server or designed the apps to notify each other when purchases are made. Then, you could have App1 check the server (or the shared record) to determine if App2 has made the purchase.

Your scenario

As for the scenario you mentioned, where a user with App1 (which you made) can upgrade within App2 (which you also made) for free, it would be kind of complicated, but certainly doable.

Basically, you'd add a custom URL scheme for each. That would allow App2 to see if App1 is installed. Then, within App2 you'd have some logic like this...

BOOL userHasInstalledAppOne = [/*here's where you check for the URL scheme*/];
if(userHasInstalledAppOne) {
// Show "upgrade for free!" button
} else {
// Show "purchase upgrade" button
}


Related Topics



Leave a reply



Submit