Can I launch one app from other app on iPhone
Yes you can achieve this using custom URL Schemes. See Communicating with Other Apps.
App B will need to register a custom URL Scheme which App A uses to launch B and pass it commands.
The following code fragment illustrates how one app can request the services of another app. “todolist” in this example is a hypothetical custom scheme registered by App B.
NSURL *myURL = [NSURL URLWithString:@"todolist://www.acme.com?Quarterly%20Report#200806231300"];
[[UIApplication sharedApplication] openURL:myURL];
Cannot Launch an app from within another (iPhone)
Add the custom Url in info.plist
1st image - In Your App which you are opening
2nd Image - In Your App which from you are opening
For full explanation and code visit my blog here
Open a app within an app or if not already downloaded, got to app store (iOS)
if UIApplication.shared.canOpenURL(other app scheme)
{
UIApplication.shared.open(other app scheme)
}else {
UIApplication.shared.open(AppStore url)
}
Swift: How to open a new app when UIButton is tapped
Try this. For example you want to open an Instagram app:
let instagramHooks = "instagram://user?username=johndoe"
let instagramUrl = URL(string: instagramHooks)!
if UIApplication.shared.canOpenURL(instagramUrl)
{
UIApplication.shared.open(instagramUrl)
} else {
//redirect to safari because the user doesn't have Instagram
UIApplication.shared.open(URL(string: "http://instagram.com/")!)
}
How to launch another app from an iPhone app
Try to do this way :
NSString *wazeAppURL = @"waze://";
NSString *mapsAppURL = @"maps://";
BOOL canOpenURL = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:wazeAppURL]];
NSString *url = canOpenURL ? wazeAppURL : mapsAppURL;
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
Here, canOpenURL
allows you to test if the Waze app is installed on your iPhone. if iPhone can open the url waze://
it means you already have the app and it will launch it. Otherwise it will launch the default Maps app. Safari won't be called.
Launch Another IOS App from Xamarin Forms App
You need to add the URL Scheme of the target app into the info.plist file in order to use canOpen
functionality. i.e
Related Topics
How to Animate Constraint Changes
Converting String to Int With Swift
Ios Launching Settings -≫ Restrictions Url Scheme
Conditional Binding: If Let Error - Initializer For Conditional Binding Must Have Optional Type
Waiting Until Two Async Blocks Are Executed Before Starting Another Block
Prevent Screen Capture in an iOS App
Returning Data from Async Call in Swift Function
How to Set Cornerradius For Only Top-Left and Top-Right Corner of a Uiview
Cfnetwork Sslhandshake Failed iOS 9
Ios - Dismiss Keyboard When Touching Outside of Uitextfield
Having a Uitextfield in a Uitableviewcell
Tricks For Improving Iphone Uitableview Scrolling Performance