Detect if app has been downloaded from integrated app store IOS

app-store, ios, objective-c

Solution

I dont think you can detect if user has pressed install or an app is installed when using `SKStoreProductViewController` [docs]. Only API iOS exposes is `loadProductWithParameters:completionBlock:`.

But if you want to check if your app has installed or not there are other ways -

1) Using custom URL scheme. Define a custom URL scheme for your app and then check using `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. Custom URL scheme check can be done something like this -

BOOL fullApp = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:NSString* urlString = [NSString stringWithFormat:@"yourFULLAppURL://"]]];
            
if(!fullApp)
{
    NSLog(@"INVALID URL"); //Or alert or anything you want to do here
}

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

Problem

I am displaying on the touch of a button inside my app, an app on the appstore. The app pops up in a SKStoreProductViewController with the content of the app store. Now, is there any method to detect if the user has pressed install on the shown app, or even better, be alerted if the user has pressed intall and the app has finished installing? Since the user in my app in this way is capable of buying the fill version, I want to quit the trial when the download is over.

Original source