launch other apps

Is there a way to launch a different app from inside a corona app.

Simple example
Create a button that when pressed then takes me out of my app and then opens up Facetime or skype.

If not, would there be a way to do it in Enterprise? [import]uid: 90878 topic_id: 35242 reply_id: 335242[/import]

Hi Gregory,
Below is the code to accomplish this. Basically, the Corona app will attempt to open the other app by its URL scheme. If the app is installed, it jumps out and opens it. If it’s not installed, it will go to the App Store and prompt for download (or, you can choose to do whatever else… show an error message, silently “fail” and do nothing, whatever).

If you need an “incomplete” reference to common/known URL schemes to define in line 6, you can refer to the list below. I don’t see all of them listed, so you might just try experimenting with what seems logical and testing it out. For example, Skype is not actually listed for some bizarre reason, but typing in “skype://” in the code works for me.
http://wiki.akosma.com/IPhone_URL_Schemes

local button = display.newRect (20,100,200,50)  
  
local function onObjectTouch( self, event )  
 if event.phase == "began" then  
 print("opening...")  
 local isAppInstalled = system.openURL("skype://")  
 if ( isAppInstalled == false ) then  
 --open app store for Skype if it is not installed  
 system.openURL("http://itunes.apple.com/br/app/skype/id304878510?mt=8")  
 end  
 end  
  
 return true -- IMPORTANT  
end  
  
-- begin detecting touches  
button.touch = onObjectTouch  
button:addEventListener( "touch", button )  

Does this answer your question sufficiently?

Best regards,
Brent [import]uid: 200026 topic_id: 35242 reply_id: 140101[/import]

If the app you are trying to launch has a URL Scheme defined you can use that as well, but the app vendor would have to let you know about it. [import]uid: 199310 topic_id: 35242 reply_id: 140125[/import]

Hi Gregory,
Below is the code to accomplish this. Basically, the Corona app will attempt to open the other app by its URL scheme. If the app is installed, it jumps out and opens it. If it’s not installed, it will go to the App Store and prompt for download (or, you can choose to do whatever else… show an error message, silently “fail” and do nothing, whatever).

If you need an “incomplete” reference to common/known URL schemes to define in line 6, you can refer to the list below. I don’t see all of them listed, so you might just try experimenting with what seems logical and testing it out. For example, Skype is not actually listed for some bizarre reason, but typing in “skype://” in the code works for me.
http://wiki.akosma.com/IPhone_URL_Schemes

local button = display.newRect (20,100,200,50)  
  
local function onObjectTouch( self, event )  
 if event.phase == "began" then  
 print("opening...")  
 local isAppInstalled = system.openURL("skype://")  
 if ( isAppInstalled == false ) then  
 --open app store for Skype if it is not installed  
 system.openURL("http://itunes.apple.com/br/app/skype/id304878510?mt=8")  
 end  
 end  
  
 return true -- IMPORTANT  
end  
  
-- begin detecting touches  
button.touch = onObjectTouch  
button:addEventListener( "touch", button )  

Does this answer your question sufficiently?

Best regards,
Brent [import]uid: 200026 topic_id: 35242 reply_id: 140101[/import]

If the app you are trying to launch has a URL Scheme defined you can use that as well, but the app vendor would have to let you know about it. [import]uid: 199310 topic_id: 35242 reply_id: 140125[/import]

Just a quick follow up on this. Say you want to support multiple Apps, is there a way to detect (without opening first) whether an app is installed? Say you’ve got a camera app and you want to open an image editing tool, there’s dozen of those which could be opened, is there a simple way of giving the user a choice of which app to open depending on what they’ve got installed?

Just a quick follow up on this. Say you want to support multiple Apps, is there a way to detect (without opening first) whether an app is installed? Say you’ve got a camera app and you want to open an image editing tool, there’s dozen of those which could be opened, is there a simple way of giving the user a choice of which app to open depending on what they’ve got installed?