iOS Question I think my app is haunted - downloaded file changes randomly

MikeH

Well-Known Member
Licensed User
Longtime User
B4X:
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download(URL & "myTextFile")
    
    Wait For (j) JobDone(j As HttpJob)

    Log("DL success: " & j.Success)
    Log(j.GetString)
    j.release

This is in a 30 second timer.
In B4A it works perfectly.
In B4i it downloads but will revert to previous versions of the file that have been overwritten on my server.
The file is uploaded correctly (checked with Android version of same app, with WinSCP and with browser).

So, as an example:

30s tick: may show correct file or previous file

I update the file

Repeat.


I've tried with 60s tick, same issue.

Possible causes:

I'm awaiting SSL certification of my server and temporarily using #PlistExtra: <key>NSExceptionDomains</key><dict> - I wonder if iOS is buffering dl'd data?

Any ideas anyone?

*SSL certificate is now active so will try again with HTTPS
 
Solution
Might be related to the server caching configuration.

Try to add something like:
B4X:
url = url & "?dummy=" & DateTime.Now

MikeH

Well-Known Member
Licensed User
Longtime User
iOS doesn't cache the response.
Are you sure that j.Success is true?

Better to write it:
B4X:
Log("DL success: " & j.Success)
If j.Success Then
 Log(j.GetString)
End If
j.Release
Thanks Erel, I've tried this already and I get the same thing happening
 
Upvote 0

MikeH

Well-Known Member
Licensed User
Longtime User
Thank you so much Erel, this was the solution :)
Might be related to the server caching configuration.

Try to add something like:
B4X:
url = url & "?dummy=" & DateTime.Now
 
Upvote 0
Top