I want to check whether an app is present in my iphone or not. If it is present I want to launch it else open the App Store link of the app.
Please suggest the required
You can check whether app is available or not using URL scheme iOS feature and then open iTunes url.Try with following code for your solution:
First set URL scheme "testapp" in your itunes app and then use following code in other app from where you want to open your app :
-(IBAction) openApp:(id)sender {
// Opens the app if installed, otherwise displays an error
UIApplication *yourApplication = [UIApplication sharedApplication];
NSString *URLEncodedText = [self.textBox.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *ourPath = [@"testapp://" stringByAppendingString:URLEncodedText];
NSURL *ourURL = [NSURL URLWithString:ourPath];
if ([yourApplication canOpenURL:ourURL]) {
[yourApplication openURL:ourURL];
}
else {
//The App is not installed. It must be installed from iTunes code.
NSString *iTunesLink = @"//Your itunes Url";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];
}
}