Search code examples
ioskeychain

Unlock a feature in App A if App B is installed


I have two iOS applications say App A and App B. I need to implement a feature like follows:

If user is installed my App A, then I need to ask user to install my App B (if not installed) to unlock a special feature in App A.

My issues:

  • How to find my App B is installed or not ?
  • If App B is installed how to unlock a feature in App A ?
  • Can I share the data through Keychain ?

What I tried:

  • I searched alot but couldn't find any tutorials or sample codes
  • Checked apple documentation but couldn't get any options
  • I saw a similar functionality in Talking Ginger application. It asks to install another application from similar company to get extra credits.

I think there is someway to do this without using private frameworks because the above mentioned apps are approved by apple and available in app store.

Thanks in advance


Solution

  • Why dont you use iOS URL Schema canOpenURL. Using Url schema you can find an application is installed or not.

    UIApplication *myApplication = [UIApplication sharedApplication];
    NSString *myPath = @"appURL://";
    NSURL *myURL = [NSURL URLWithString:myPath];
    if ([myApplication canOpenURL:myURL]) {
        //Installed
        //Go for unlock login
    }
    else {
        //Not Installed
        //Inform user application not installed and redirect to iTunes Application url 
    }