- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to launch any arbitrary iPhone application from within another app?
iOS Allows us to open some applications with some links or other ways from our app, like dialing a number when clicked on it, or writing a mail with some static body or writing a SMS. But this is limited to some applications, not every app can be opened from within an application.
Specifically it is limited to apps that have a registered URL Scheme. For example if you want to open a SMS from your app, it is possible using the registered URL Scheme.
Some of the applications that can be opened with URL schemes and how to open them are mentioned below.
Opening Phone Dialer with iOS
To call a number from our application we have to use URL scheme tel:// followed by the mobile number to call, when this action is performed it opens up the dialer.
We have to create a url to open dialer,
URL(string: "tel://\(number)"), UIApplication.shared.canOpenURL(url)
One example of a function to dial a number is −
func callNumber(number: String) { if let url = URL(string: "tel://\(number)"), UIApplication.shared.canOpenURL(url) { if #available(iOS 10, *) { UIApplication.shared.open(url) } else { UIApplication.shared.openURL(url) } } }
Similar to this, URL Scheme example to open some other apps are −
UIApplication.shared.openURL(URL(string:"https://api.whatsapp.com/send?ph one=\(mobile_number)")!) Contacts - contacts:// iBooks – ibooks:// itunes - itms-itunesu:// photos - photos-redirect:// safari - x-web-search:// facebook - fb:// google Chrome - googlechrome:// messenger - fb-messenger:// skype - skype:// twitter – twitter://
- Related Articles
- How to launch another app from your app?
- How to Launch an application from another application on Android
- How to exit iPhone application gracefully?
- How can I send mail from an iPhone application?
- Prevent iPhone from zooming in web-app with HTML
- PHP – How to subtract one arbitrary precision number from another using bcsub() function?
- How to import classes from within another directory/package in Java?
- Launching the App Store from an iOS application
- How to launch activity only once when Android app is opened for the first time?
- How to open a website in Android’s web browser from any application?
- PHP – How to raise an arbitrary precision number to another using bcpow() function?
- Exact Radius and Size of iPhone App Icons
- How to run a timer in background within your iOS app
- Where are the app cookies stored on the iPhone?
- How to access RESTFul services from iOS/iPhone?
