Hi,
I have a “Invite a friend” screen which works well on Android but it doesn’t work on my iPad.
The problem is that I download the images and then show them but they do not appear on the iPad so I was wondering if this might be because of the documents directory or something like that on IOS?
Might be a missing permission as well, I’m not really sure.
-- Get URL to Facebook Image local picture = friends[i].picture local url for key,value in pairs (picture) do if key == "data" then for k, v in pairs(value) do if k == "url" then url = v end end end end if util.doesFileExist( "profile\_photos/" .. data.id .. ".jpg", system.DocumentsDirectory ) then local img = display.newImage("profile\_photos/" .. data.id .. ".jpg", system.DocumentsDirectory, txt.x - 4, txt.y) scrollView:insert( img ) img.anchorX = 1 listener( img ) else print("To download FB image") downloadingFacebookImages = downloadingFacebookImages + 1 local function networkListener(event) if ( event.isError ) then print ( "Network error - download failed" ) elseif event.phase == "ended" then for k,v in pairs(event) do print(k,v) end local img = display.newImage( event.response.filename, event.response.baseDirectory, txt.x - 4, txt.y ) --local img = display.newImage(event.target, txt.x - 4, txt.y) scrollView:insert( img ) img.anchorX = 1 listener( img ) --event.target.anchorX = 1 scrollView:insert( event.target ) end downloadingFacebookImages = downloadingFacebookImages - 1 end network.download( url, "GET", networkListener, params, "profile\_photos/" .. data.id .. ".jpg", system.DocumentsDirectory ) end
I take the link and try to download it to system.documentsDirectory
Best regards,
Tomas