Open Third party apps

Can you launch third party apps from your own app developed in corona?

I know is possible using Phonegap where you check if the app id exist i.e: com.corona.testapp and if exists you can call it and open it.

Regards,

Andrew

Hi Andrew,

The following code may help:

[lua]

display.setStatusBar( display.HiddenStatusBar )

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 appstore 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 )

[/lua]

And this thread explains some usage on Android:

http://forums.coronalabs.com/topic/37105-handling-url-scheme-on-android/

Brent

Hi Andrew,

The following code may help:

[lua]

display.setStatusBar( display.HiddenStatusBar )

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 appstore 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 )

[/lua]

And this thread explains some usage on Android:

http://forums.coronalabs.com/topic/37105-handling-url-scheme-on-android/

Brent

Thanks for the code Brent. 

Thanks for the code Brent.