I want to open iphone apps like Contacts and Calendar from within my phonegap app, I don't mind that doing so will put my app in the background. I can open the browser and using window.open but how do I open other apps?
eg window.open("contacts://", '_blank');
doesn't work
You are going to need to write a custom phonegap plugin so that you can access custom methods you write in objective C.
The official phonegap documentation is here.
I'll briefly explain how you will do this.
In your javascript you will call this code :
In objective C you will create a new file OpenMailAppPlugin class. Read the link above for exact instuctions, but the important method will be soemthing like this.
additionally, you may be interested in sending information back to your phonegap application. You can do this by injecting a javascript call that sends parameters. In your objective C function you would do something like this.
Need to use a plugin, unfortunately you need native ios code:
This one works: https://github.com/phonegap/phonegap-plugins/tree/master/iOS/ExternalFileUtil
As previously answered, using a URL scheme can work. If you have several apps and you want to be able to open one from the other, then it's really simple when using PhoneGap build: you just need to add the URL scheme to your config.xml file, eg:
Then from your other app you'll just have a link to
app1scheme://
, eg simplyHere is the list of all the iOS/iPhone app url
More can be found at this outdated link http://www.wiki.akosma.com/IPhone_URL_Schemes
Look at this on how you can implement your's url
https://appurl.org/docs-handling-android
The only way that one app, PhoneGap-based or otherwise, can cause another app to launch is to open an URL that uses the target app's custom URL scheme. So, if the Contacts app supports some custom scheme, you're in luck. If not, you're out of luck.