Downloading data for in app purchases

How would one download a file?
Were would it go?
How would we access it?
Could it be a .lua file?

(A lot of questions!)

-Gamexcb [import]uid: 8517 topic_id: 6053 reply_id: 306053[/import]

good questions.

really, nobody could answer that?

cu
t [import]uid: 10834 topic_id: 6053 reply_id: 28381[/import]

How do you download a file?
http://developer.anscamobile.com/reference/index/networkdownload

Where does it go?
http://developer.anscamobile.com/reference/index/systempathforfile

How do you access it?
Depends on the second link above, but that first link shows an example.

Could it be a Lua file?
Yes, but unless you include a Lua interpreter in your app (and I don’t think Corona allows that) you can’t do anything with a Lua file. Apple doesn’t like (or allow?) scripts to be downloaded that are then run in the app.

If you’re going to download something it should probably be data that your app can then manipulate.

Hope that helps.

Jay
[import]uid: 9440 topic_id: 6053 reply_id: 28448[/import]

Well, I have the same problem (slightly).
I figured out the differences between ResourceDirectory, TempDirectory, DocumentsDirectory.
I am downloading a PDF file at the start of my App and I’m showing it via WebPopup which is all working very well.

But: The PDF File should be stored on the iPhone, so I can look at the PDF even when I’m offline.
Right now the App will download the PDF every time I start the App…
Apparently the downloaded file is deleted (sandbox) when I close the App.

any ideas how to create it so that the PDF stays?

[import]uid: 45296 topic_id: 6053 reply_id: 28623[/import]

If you download it to the DocumentsDirectory then it should hang around even after you close the app. Is that what you’re doing?

Jay [import]uid: 9440 topic_id: 6053 reply_id: 28648[/import]