I have 2 apps, which are meant for different purpose, where I should not allow user to use both apps in same device. How can I check whether other app installed or not? I t
To know whether an app is installed or not
-(BOOL) isAppInstalled:(NSString *)appUrl{
return [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:appUrl]]; // @ is not needed as you are passing input of function as a parameter.
}
To know whether any app got installed or not, invoke this function
if( [self isAppInstalled:@"MyApp2://"]) {
NSLog("The second app is installed"); //Perform your actions
}
Remember to include the second app's url scheme in First Apps LSApplicationURLScheme in its Info.plist.