API network request call work fine on simulator but not on device

Hi
I am new to this forum but I am just hooking up Pixabay API to Corona SDK in an app I am writing. Everything works fine on the simulator but I get the following response below on a device (tested on iPhone 11 and IPad2). Has anybody else come across this with pixabay or another api calls . I quickly wrote something for pexels as well and got the same response. Any advice gratefully received, I am just using the network request to make a simple API call to pixabay (pexels) seems simple but clearly not

Code working on simulator output

Response on simulator using network.request call to pixabay ALL GOOD


–Corona SDK Simulator Response for same URL CALL using

table: 0x7fde23ecf870 {
[responseHeaders] => table: 0x7fde23ecf870 {
[Connection] => “keep-alive”
[Content-Type] => “image/jpeg”
[Cf-Bgj] => “imgq:85,h2pri”
[Date] => “Fri, 14 Aug 2020 15:46:03 GMT”
[Last-Modified] => “Mon, 25 Feb 2019 23:01:23 GMT”
[x-amz-id-2] => “5ExTkJ6UmPX+4CisFz4PDyx5KZq5ygpC3BVSdpOzjN9Ct5FH1xbu9NmJls+ZghEmpMyHSZXJjeY=”
[Server] => “cloudflare”
[Cf-Polished] => “degrade=85, origSize=5750”
[Content-Length] => “4689”
[CF-Cache-Status] => “HIT”
[Etag] => ““aa8bb6d2d03670f82896a6994883a05b””
[Age] => “1928”
[CF-Ray] => “5c2bce763c920091-LHR”
[Expect-CT] => “max-age=604800, report-uri=“https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct””
[x-amz-version-id] => “vDI4g_lUVyddLWagga4AkOxx2dkRfPx9”
[x-amz-request-id] => “28D8D2C8F29DA984”
[Vary] => “Accept, Origin, Accept-Encoding”
[Accept-Ranges] => “bytes”
[Access-Control-Allow-Origin] => “*”
[alt-svc] => “h3-27=”:443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400"
[cf-request-id] => “048f3f5de0000000919bad4200000001”
}
[responseType] => “binary”
[phase] => “ended”
[bytesEstimated] => 4689
[response] => table: 0x7fde23ecf870 {
[fullPath] => “/Users/davidfilbee/Library/Application Support/Corona Simulator/DiamondPainting NoStatusMap-7DBAE2F1C14D1F32F866DD8DA76652D6/tmp/1.jpg”
[filename] => “1.jpg”
[baseDirectory] => userdata: 0x10ea6cbd2
}
[name] => “networkRequest”
[bytesTransferred] => 4689
[status] => 200
[url] => “https://cdn.pixabay.com/photo/2014/09/03/20/15/legs-434918_150.jpg”
[isError] => false
[requestId] => userdata: 0x7fde23ece028
}

same code and network request on devices

–IOS Device Response for same network.request using same code and url

[Device] https://cdn.pixabay.com/photo/2015/09/09/16/40/ocean-931776_150.jpg
[Device] Task .<0> {strength 1, tls 8, ct 0, sub 0, sig 0, ciphers 1, bundle 0, builtin 0}
[Device] Task .<0> now using Connection 1
[Device] Task .<0> sent request, body N 0
[Device] Task .<0> received response, status 403 content C
[Device] Task .<0> response ended
[Device] Task .<0> done using Connection 1
[Device] Download starting, estimated size: 3105
[Device] Task .<0> summary for task success {transaction_duration_ms=16, response_status=403, connection=1, reused=1, request_start_ms=1, request_duration_ms=0, response_start_ms=14, response_duration_ms=1, request_bytes=330, response_bytes=1581, cache_hit=0}
[Device] Download progress: 3105 of estimated: 3105
[Device] Download complete, total bytes transferred: 3105 nil

Device] table: 0x282a4ec00 {
[Device] [responseHeaders] => table: 0x282a4ec00 {
[Device] [alt-svc] => “h3-27=”:443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400"
[Device] [Content-Type] => “text/html; charset=UTF-8”
[Device] [Date] => “Fri, 14 Aug 2020 16:57:13 GMT”
[Device] [X-Frame-Options] => “SAMEORIGIN”
[Device] [Transfer-Encoding] => “Identity”
[Device] [CF-RAY] => “5c2c36b61dd50796-LHR”
[Device] [Content-Encoding] => “br”
[Device] [Connection] => “keep-alive”
[Device] [Cache-Control] => “private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0”
[Device] [Vary] => “Accept-Encoding”
[Device] [Expect-CT] => “max-age=604800, report-uri=“https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct””
[Device] [Expires] => “Thu, 01 Jan 1970 00:00:01 GMT”
[Device] [Server] => “cloudflare”
[Device] [cf-request-id] => “048f8085cb00000796cb210200000001”
[Device] }
[Device] [responseType] => “text”
[Device] [phase] => “ended”
[Device] [bytesEstimated] => 3104
[Device] [response] => "
[Device] [name] => “networkRequest”
[Device] [bytesTransferred] => 3104
[Device] [status] => 403
[Device] [url] => “https://cdn.pixabay.com/photo/2014/09/03/20/15/legs-434918_150.jpg”
[Device] [isError] => false
[Device] [requestId] => userdata: 0x283e5cef8
[Device] }

[Device] Connection 3: TLS Trust result 0
[Device] boringssl_context_certificate_verify_callback_block_invoke_3(2080) [C3.1:2][0x105012cb0] Returning from verify block
[Device] boringssl_context_certificate_verify_callback(2047) [C3.1:2][0x105012cb0] Setting trust result to ssl_verify_ok
[Device] boringssl_context_info_handler(1983) [C3.1:2][0x105012cb0] Client handshake state: TLS 1.3 client read_server_finished
[Device] boringssl_context_message_handler(2258) [C3.1:2][0x105012cb0] Reading SSL3_RT_HANDSHAKE 36 bytes
[Device] boringssl_context_info_handler(1983) [C3.1:2][0x105012cb0] Client handshake state: TLS 1.3 client send_end_of_early_data
[Device] boringssl_context_info_handler(1983) [C3.1:2][0x105012cb0] Client handshake state: TLS 1.3 client send_client_certificate
[Device] boringssl_context_info_handler(1983) [C3.1:2][0x105012cb0] Client handshake state: TLS 1.3 client complete_second_flight
[Device] boringssl_context_message_handler(2258) [C3.1:2][0x105012cb0] Writing SSL3_RT_HANDSHAKE 36 bytes
[Device] boringssl_context_info_handler(1983) [C3.1:2][0x105012cb0] Client handshake state: TLS 1.3 client done
[Device] boringssl_context_info_handler(1983) [C3.1:2][0x105012cb0] Client handshake state: TLS client finish_client_handshake
[Device] boringssl_context_info_handler(1983) [C3.1:2][0x105012cb0] Client handshake state: TLS client done
[Device] boringssl_context_copy_peer_sct_list(1003) [C3.1:2][0x105012cb0] SSL_get0_signed_cert_timestamp_list returned no SCT extension data
[Device] boringssl_helper_create_sec_trust_with_certificates(607) [C3.1:2][0x105012cb0] SecTrustCreateWithCertificates result: 0
[Device] boringssl_helper_create_sec_trust_with_certificates(614) [C3.1:2][0x105012cb0] No TLS-provided OCSP response
[Device] boringssl_helper_create_sec_trust_with_certificates(621) [C3.1:2][0x105012cb0] No TLS-provided SCTs
[Device] boringssl_context_add_handshake_message_pending(578) [C3.1:2][0x105012cb0] Adding message(20)
[Device] boringssl_context_info_handler(1974) [C3.1:2][0x105012cb0] Client handshake done
[Device] nw_protocol_boringssl_signal_connected(701) [C3.1:2][0x105012cb0] TLS connected [version(0x0304) ciphersuite(0x1301) group(0x001d) peer_key(0x0403) alpn(http/1.1) resumed(0) offered_ticket(0) false_started(0) ocsp(0) sct(0)]
[Device] nw_flow_connected [C3.1 IPv4#ca7554d0:443 in_progress channel-flow (satisfied (Path is satisfied), interface: en0, ipv4, dns)] Output protocol connected
[Device] Connection 3: connected successfully
[Device] Connection 3: TLS handshake complete
[Device] Connection 3: ready C(N) E(N)
[Device] Task <6ACBB127-15E8-45C2-BF5C-5745FB7F58BD>.<0> now using Connection 3
[Device] Connection 3: received viability advisory(Y)
[Device] Task <6ACBB127-15E8-45C2-BF5C-5745FB7F58BD>.<0> sent request, body N 0
[Device] Connection 4: TLS Trust result 0
[Device] boringssl_context_certificate_verify_callback_block_invoke_3(2080) [C4.1:2][0x105405810] Returning from verify block
[Device] boringssl_context_certificate_verify_callback(2047) [C4.1:2][0x105405810] Setting trust result to ssl_verify_ok
[Device] boringssl_context_info_handler(1983) [C4.1:2][0x105405810] Client handshake state: TLS 1.3 client read_server_finished
[Device] boringssl_context_message_handler(2258) [C4.1:2][0x105405810] Reading SSL3_RT_HANDSHAKE 36 bytes
[Device] boringssl_context_info_handler(1983) [C4.1:2][0x105405810] Client handshake state: TLS 1.3 client send_end_of_early_data
[Device] boringssl_context_info_handler(1983) [C4.1:2][0x105405810] Client handshake state: TLS 1.3 client send_client_certificate
[Device] boringssl_context_info_handler(1983) [C4.1:2][0x105405810] Client handshake state: TLS 1.3 client complete_second_flight
[Device] boringssl_context_message_handler(2258) [C4.1:2][0x105405810] Writing SSL3_RT_HANDSHAKE 36 bytes
[Device] boringssl_context_info_handler(1983) [C4.1:2][0x105405810] Client handshake state: TLS 1.3 client done
[Device] boringssl_context_info_handler(1983) [C4.1:2][0x105405810] Client handshake state: TLS client finish_client_handshake
[Device] boringssl_context_info_handler(1983) [C4.1:2][0x105405810] Client handshake state: TLS client done
[Device] boringssl_context_copy_peer_sct_list(1003) [C4.1:2][0x105405810] SSL_get0_signed_cert_timestamp_list returned no SCT extension data
[Device] boringssl_helper_create_sec_trust_with_certificates(607) [C4.1:2][0x105405810] SecTrustCreateWithCertificates result: 0
[Device] boringssl_helper_create_sec_trust_with_certificates(614) [C4.1:2][0x105405810] No TLS-provided OCSP response
[Device] boringssl_helper_create_sec_trust_with_certificates(621) [C4.1:2][0x105405810] No TLS-provided SCTs
[Device] boringssl_context_add_handshake_message_pending(578) [C4.1:2][0x105405810] Adding message(20)
[Device] boringssl_context_info_handler(1974) [C4.1:2][0x105405810] Client handshake done
[Device] nw_protocol_boringssl_signal_connected(701) [C4.1:2][0x105405810] TLS connected [version(0x0304) ciphersuite(0x1301) group(0x001d) peer_key(0x0403) alpn(http/1.1) resumed(0) offered_ticket(0) false_started(0) ocsp(0) sct(0)]
[Device] nw_flow_connected [C4.1 IPv4#ca7554d0:443 in_progress channel-flow (satisfied (Path is satisfied), interface: en0, ipv4, dns)] Output protocol connected
[Device] Connection 4: connected successfully
[Device] Connection 4: TLS handshake complete
[Device] Connection 4: ready C(N) E(N)
[Device] Task <621706EC-B7BB-4AA6-88B6-10617AA9FCEC>.<0> now using Connection 4
[Device] Connection 4: received viability advisory(Y)
[Device] Task <621706EC-B7BB-4AA6-88B6-10617AA9FCEC>.<0> sent request, body N 0
[Device] Connection 5: TLS Trust result 0
[Device] boringssl_context_certificate_verify_callback_block_invoke_3(2080) [C5.1:2][0x1054053f0] Returning from verify block
[Device] boringssl_context_certificate_verify_callback(2047) [C5.1:2][0x1054053f0] Setting trust result to ssl_verify_ok
[Device] boringssl_context_info_handler(1983) [C5.1:2][0x1054053f0] Client handshake state: TLS 1.3 client read_server_finished
[Device] boringssl_context_message_handler(2258) [C5.1:2][0x1054053f0] Reading SSL3_RT_HANDSHAKE 36 bytes
[Device] boringssl_context_info_handler(1983) [C5.1:2][0x1054053f0] Client handshake state: TLS 1.3 client send_end_of_early_data
[Device] boringssl_context_info_handler(1983) [C5.1:2][0x1054053f0] Client handshake state: TLS 1.3 client send_client_certificate
[Device] boringssl_context_info_handler(1983) [C5.1:2][0x1054053f0] Client handshake state: TLS 1.3 client complete_second_flight
[Device] boringssl_context_message_handler(2258) [C5.1:2][0x1054053f0] Writing SSL3_RT_HANDSHAKE 36 bytes
[Device] boringssl_context_info_handler(1983) [C5.1:2][0x1054053f0] Client handshake state: TLS 1.3 client done
[Device] boringssl_context_info_handler(1983) [C5.1:2][0x1054053f0] Client handshake state: TLS client finish_client_handshake
[Device] boringssl_context_info_handler(1983) [C5.1:2][0x1054053f0] Client handshake state: TLS client done
[Device] boringssl_context_copy_peer_sct_list(1003) [C5.1:2][0x1054053f0] SSL_get0_signed_cert_timestamp_list returned no SCT extension data
[Device] boringssl_helper_create_sec_trust_with_certificates(607) [C5.1:2][0x1054053f0] SecTrustCreateWithCertificates result: 0
[Device] boringssl_helper_create_sec_trust_with_certificates(614) [C5.1:2][0x1054053f0] No TLS-provided OCSP response
[Device] boringssl_helper_create_sec_trust_with_certificates(621) [C5.1:2][0x1054053f0] No TLS-provided SCTs
[Device] boringssl_context_add_handshake_message_pending(578) [C5.1:2][0x1054053f0] Adding message(20)
[Device] boringssl_context_info_handler(1974) [C5.1:2][0x1054053f0] Client handshake done
[Device] nw_protocol_boringssl_signal_connected(701) [C5.1:2][0x1054053f0] TLS connected [version(0x0304) ciphersuite(0x1301) group(0x001d) peer_key(0x0403) alpn(http/1.1) resumed(0) offered_ticket(0) false_started(0) ocsp(0) sct(0)]

Anybody come across this …any advice to resolve greatly received

Thanks
David

My experience with network.request() is that it works pretty much the same on both simulator and the device so I’m guessing this must be something related with your use of the API. Can you put together a sample project and upload here so we can take a look at that?

Don’t forget about build.setting networking permissions settings for Apple/Android.

Hi roaming Gamer Thank you for your comment
where do I find the build settings network permission for Apple

Hi there … I can set up a simple project but to test you need to release the API key but it really comes down to a simple url call . I have done some digging and this response seems to come down to IOS 13 not sure what though

https://docs.coronalabs.com/guide/distribution/buildSettings/index.html

https://docs.coronalabs.com/guide/hardware/appleATS/index.html

Hi, Thank you for the links, I had not found those. I have read all the documents you provided and also the apple detailed instructions and played with the build settings to try and get things moving unfortunately with little success. I am not great at network related stuff I am afraid. The current state of the build settings is this and it does change the response of the server. Do you know if I am on the right track or am I missing something fundamental

Thank you for the advice to date I am completely foxed by this one.

Current Build Settings added

NSAppTransportSecurity =
            {
                NSExceptionDomains =
                {
                    ["pixabay.com"] =
                    {
                        NSIncludesSubdomains = true,
                        NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
                        NSExceptionRequiresForwardSecrecy = false,
                        NSThirdPartyExceptionRequiresForwardSecrecy = false,
                        NSRequiresCertificateTransparency = false
                    },

                    ["api.pexels.com"] =
                    {
                        NSIncludesSubdomains = true,
                        NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
                        NSExceptionRequiresForwardSecrecy = false,
                        NSThirdPartyExceptionRequiresForwardSecrecy = false,
                        NSRequiresCertificateTransparency = false
                    },
                },
            },

Having trouble connecting to the build server at the moment so can’t run to show network response, will post as soon as I can connect.

Thank you for your help

Just managed to build again, this is the response from the server for build settings above

Aug 27 09:59:32.817 [Device] Connection 1: is being canceled
Aug 27 09:59:32.817 [Device] [C1 980ACA64-BFF4-45F5-84F9-47E2304AC99E Hostname#ab925795:443 tcp, url hash: 270a9f19, tls] cancel
Aug 27 09:59:32.833 [Device] [C1 980ACA64-BFF4-45F5-84F9-47E2304AC99E Hostname#ab925795:443 tcp, url hash: 270a9f19, tls] cancelled
Aug 27 09:59:32.833 [Device] [C1.1 FCC90B84-9875-4819-8C58-61D7C8291F6C 2a04:4a43:4bff:9cab:1967:8da5:59a9:153f.60494<->IPv6#50104bd2.443] [Device] Connected Path: satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive [Device] Duration: 1.389s, DNS @0.000s took 0.071s, TCP @0.072s took 0.092s, TLS took 0.131s [Device] bytes in/out: 4570/997, packets in/out: 6/3, rtt: 0.088s, retransmitted packets: 0, out-of-order packets: 0 [Device] 0.000s [C1 CDFDBCFB-465C-45A1-8CB2-52526B684997 Hostname#ab925795:443 resolver path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] path:start [Device] 0.000s [C1 CDFDBCFB-465C-45A1-8CB2-52526B684997 Hostname#ab925795:443 resolver path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] path:satisfied [Device] 0.000s [C1 CDFDBCFB-465C-45A1-8CB2-52526B684997 Hostname#ab925795:443 resolver path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] resolver:start_dns [Device] 0.071s [C1 CDFDBCFB-465C-45A1-8CB2-52526B684997 Hostname#ab925795:443 resolver path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] resolver:receive_dns [Device] 0.071s [C1.1 FCC90B84-9875-4819-8C58-61D7C8291F6C 2a04:4a43:4bff:9cab:1967:8da5:59a9:153f.60494<->IPv6#50104bd2.443 channel-flow path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] path:start [Device] 0.071s [C1.1 FCC90B84-9875-4819-8C58-61D7C8291F6C 2a04:4a43:4bff:9cab:1967:8da5:59a9:153f.60494<->IPv6#50104bd2.443 channel-flow path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] path:satisfied [Device] 0.071s [C1.1 FCC90B84-9875-4819-8C58-61D7C8291F6C 2a04:4a43:4bff:9cab:1967:8da5:59a9:153f.60494<->IPv6#50104bd2.443 channel-flow path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] flow:start_nexus [Device] 0.072s [C1.1 FCC90B84-9875-4819-8C58-61D7C8291F6C 2a04:4a43:4bff:9cab:1967:8da5:59a9:153f.60494<->IPv6#50104bd2.443 channel-flow path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] flow:receive_nexus [Device] 0.072s [C1.1 FCC90B84-9875-4819-8C58-61D7C8291F6C 2a04:4a43:4bff:9cab:1967:8da5:59a9:153f.60494<->IPv6#50104bd2.443 channel-flow path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] flow:start_connect [Device] 0.164s [C1.1 FCC90B84-9875-4819-8C58-61D7C8291F6C 2a04:4a43:4bff:9cab:1967:8da5:59a9:153f.60494<->IPv6#50104bd2.443 channel-flow path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] flow:finish_transport [Device] 0.164s [C1 CDFDBCFB-465C-45A1-8CB2-52526B684997 Hostname#ab925795:443 resolver path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] flow:finish_transport [Device] 0.295s [C1.1 FCC90B84-9875-4819-8C58-61D7C8291F6C 2a04:4a43:4bff:9cab:1967:8da5:59a9:153f.60494<->IPv6#50104bd2.443 channel-flow path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] flow:finish_connect [Device] 0.295s [C1 CDFDBCFB-465C-45A1-8CB2-52526B684997 Hostname#ab925795:443 resolver path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] flow:finish_connect [Device] 0.295s [C1.1 FCC90B84-9875-4819-8C58-61D7C8291F6C 2a04:4a43:4bff:9cab:1967:8da5:59a9:153f.60494<->IPv6#50104bd2.443 channel-flow path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] flow:changed_viability [Device] 0.295s [C1 CDFDBCFB-465C-45A1-8CB2-52526B684997 Hostname#ab925795:443 resolver path=satisfied (Path is satisfied), interface: pdp_ip0, ipv6, dns, expensive] flow:changed_viability [Device] 1.389s [C1] path:cancel [Device] boringssl_context_message_handler(2258) [C1.1:2][0x1016a3e80] Writing SSL3_RT_ALERT 2 bytes [Device] boringssl_context_handle_warning_alert(1893) [C1.1:2][0x1016a3e80] write alert, level: warning, description: close notify [Device] boringssl_session_disconnect(504) [C1.1:2][0x1016a3e80] SSL_shutdown 0 [Device] nw_protocol_tcp_log_summary [C1.1:3] [Device] [0E5CC869-70FE-41C5-B163-553C4E213E06 :60494<->:443] [Device] Init: 1, Conn_Time: 91.876ms, Syn’s: 1, WR_T: 0/0, RD_T: 0/0, TFO: 0/0/0, ECN: 0/0/0, TS: 1 [Device] RTT_Cache: none, rtt_upd: 3, rtt: 88.375ms, rtt_var: 32.687ms rtt_nc: 88.375ms, rtt_var_nc: 32.687ms [Device] nw_flow_disconnected [C1.1 IPv6#50104bd2.443 cancelled channel-flow ((null))] Output protocol disconnected

Thanks
David

Still working this problem… bgmadclown here is a simple version of what is being called as a simple project
Works fine on simulator but not on device. Event response is as above on device
if you type url into Safari on same iPhone all works image returned
Something to do with corona build I have tried the NSAppTransportSecurity in build settings no different.

Very confusing … any ideas to help … really struggling
Many Thanks

local count = 1

local urls = {
“https://cdn.pixabay.com/photo/2017/08/30/01/05/milky-way-2695569_150.jpg”
}

function getImage()

local function networkListener( event )
    if ( event.isError ) then
        print( "Network error: ", event.response )
 
    elseif ( event.phase == "began" ) then
        if ( event.bytesEstimated <= 0 ) then
            print( "Download starting, size unknown" )
        else
            print( "Download starting, estimated size: " .. event.bytesEstimated )
        end
 
    elseif ( event.phase == "progress" ) then
        if ( event.bytesEstimated <= 0 ) then
            print( "Download progress: " .. event.bytesTransferred )
        else
            print( "Download progress: " .. event.bytesTransferred .. " of estimated: " .. event.bytesEstimated )
        end
         
    elseif ( event.phase == "ended" ) then
        print( "Download complete, total bytes transferred: " .. event.bytesTransferred,event.response.filename )

        if event.response.filename ~= nil then 
            myImage = display.newImage( event.response.filename, event.response.baseDirectory, 60, 40 )
            myImage.alpha = 1
            myImage.x = math.random( myImage.width/2,_W- myImage.width/2)
            myImage.y = math.random( myImage.height/2,_H- myImage.height/2)

        end
        --transition.to( myImage, { alpha=1.0 } )

        count = count+1

        if count <= #urls then 
            getImage()
        end
    end
end
  
local params = {}
 
-- Tell network.request() that we want the "began" and "progress" events:
params.progress = "download"
 
-- Tell network.request() that we want the output to go to a file:
params.response = {
    filename = tostring(count)..".jpg",
    baseDirectory = system.DocumentsDirectory
}


local url = urls[count]


network.request( url, "GET", networkListener,  params )

end

getImage()

Finally fixed it … for anybody who wants to hook up to pixabay and pexels ensure the headers are set up properly in the second url call … so happy such a simple thing in the end

Device Solution now

1 Like

Glad you solved the problem. Can you share the code that was not working and the one that’s working (without your API key of course) so it stays here for future reference?