Hello,
This code works fine in simulator and Android devices, but doesn’t works in iPhone.
This is the same code that you can read in documentation about network.download.
iPhone runs iOS 10.2 and I compiled the code with Xcode 8.1 in my MacBook.
Do I need to activate any iOS extension? What is the problem?
local function networkListener( event ) if ( event.isError ) then print( "Network error - download failed: ", event.response ) elseif ( event.phase == "began" ) then print( "Progress Phase: began" ) elseif ( event.phase == "ended" ) then print( "Displaying response image file" ) myImage = display.newImage( event.response.filename, event.response.baseDirectory, 60, 40 ) myImage.alpha = 0 transition.to( myImage, { alpha=1.0 } ) end end local params = {} params.progress = true network.download( "http://docs.coronalabs.com/images/simulator/image-mask-base2.png", "GET", networkListener, params, "helloCopy.png", system.TemporaryDirectory )
In my project I used network.request() but I have the same problem too. iPhone returns Network error but works fine in Android devices and simulator.
Thanks…