openURL not working ? [iOS9]

Hey there guys, I just updated my iphone to the iOS 9 beta and downloaded the last daily build. Once I’ve opened my project the openURL stopped working on ADHOC and works only on simulator.

No log errors, it’s simple code : 

function openFB( event ) local righp = audio.loadSound( "rightp.mp3" ) audio.play( righp ) local fb = "https://www.facebook.com/touchblank" system.openURL( fb ) end fbIcon = display.newImageRect( "fbicon@2x.png", 53, 53) fbIcon.x = centerX + 110 fbIcon.y = centerY - 180 fbIcon:addEventListener( "tap", openFB )

Waiting for response :slight_smile: bye!

Im not sure exactly… But what was your build before you got the new daily build? Try adding this as your eventListener 

fbIcon:addEventListener( "touch", openFB )

instead of 

fbIcon:addEventListener( "tap", openFB )

Heres the rewritten code for you also…

fbIcon = display.newImageRect( "fbicon@2x.png", 53, 53) fbIcon.x = centerX + 110 fbIcon.y = centerY - 180 function openFB() local righp = audio.loadSound( "rightp.mp3" ) audio.play( righp ) local fb = "https://www.facebook.com/touchblank" system.openURL( fb ) end fbIcon:addEventListener( "touch", openFB )

Good Luck!

Thank you for the answer, unfortunately the “touch” makes the button play the sound twice, I would have to go through phases to do a simple task, but despite that I’ve tried this method and it didn’t work as well, this code was working fine before iOS 9 , it has to be related somehow. Thank you again for the answer, I’ll wait Rob or another staff mate to show up and see if another users had this prob too, you have a good week! =)

Probably a bug then.

yes its a bug. i already reported it. on android it doen’t work also. hope they correct it soon.

but if more people send a report of that bug maybe they correct if faster :slight_smile:

How does it not work?

Are you getting any errors?

If you reported a bug, can you also post the Case ID # that was in the subject of the email we sent you to confirm the bug filing?
 

Rob

Sorry don’t remember the case ID. No errors shown in log, it just doesn’t work

------EDIT

Thank you @SonicX278  =)

 (Case 42635)

Case ID should be in the email they sent you.

my case is 

(Case 42592)

the code i sent to bug report work fine on blackberry and ipad with 8.4.1. it doesn’t work in my nexus 7 2013 with lolipop 5.1.1 it halts the app. i need to close the app and start it again. still i will do more tests in other devices (when i will get them) to see if its a problem of some sort of configuration conflit with that tablet.

i don’t know if is system.openURL that halt the app or something internal in corona that changed that makes my app halt. for instance, when i’ve a native.newMapView() in my device, if i press the terms and conditions from google inside the map. it will open a new window, but if i return to my app, i can’t do nothing. it stoped. this behavior only happens in android, tested in 4.4.4 and 5.1.1 and blackberry bb10.3.2. in IOS works fine and simulator too. i guess the app “crashes” when call’s something outside it. system.openURL do that, so it’s normal to “crash” it. like i said this only happens in android in my case, i’m using system.openURL from more than an year, never had this problem before.

two new daily builds and this is still not working, any updates on the subject?

sorry to resurrect this topic, but I still have this problem, open URL not working :frowning: (it works on corona simulator but not on device)

local fbIcon = display.newImageRect( "fbicon@2x.png", 53, 53) fbIcon.x = centerX + 110 fbIcon.y = centerY - 180 function openFB( event ) audio.play( audio.loadSound( "rightp.mp3" ) ) system.openURL( "http://www.facebook.com/1616240441956009" ) end fbIcon:addEventListener( "tap", openFB )

I suspect a couple of things might be at play here.  First on iOS 9 you have to deal with Application Transport Security (ATS). Apple has locked down non HTTPS addresses.  See: https://coronalabs.com/blog/2015/09/17/about-app-transport-security-ats/

Secondly Apple opens a lot of installed apps where they intercept the system.OpenURL() call and directs you to the app in question.

Try it with a Non-facebook app.

Turn on ATS features.

See what’s going on. There is nothing inherently broken about system.openURL().

Rob

Hey Rob, thank you for your answer, the original link has https, I tried removing the “s” as an alternative to see if it could work. What is new for me here is the ATS subject, I will be looking into it and giving feedback as soon as possible :slight_smile:

@david wow2

I wrestled with this problem for a while and solved it here:

https://forums.coronalabs.com/topic/59340-ios-9-ats-in-laymans-terms/

Unfortunately it still didn’t work :frowning: don’t know if I did it correctly tough , tried with “facebook.com” and "https://www.facebook.com/1616240441956009"

 NSAppTransportSecurity = { NSExceptionDomains = { ["https://www.facebook.com/1616240441956009"] = { NSIncludesSubdomains = true, NSThirdPartyExceptionAllowsInsecureHTTPLoads = true }, }, },

Try:

 NSAppTransportSecurity = { NSExceptionDomains = { ["facebook.com"] = { NSIncludesSubdomains = true, NSThirdPartyExceptionAllowsInsecureHTTPLoads = true }, }, },

Still not working, I guess ATS is not the problem

Can you post your entire build.settings?