bypassing login to view files on an iphone

Hello Elgg community,

I am working on an iphone app for my elgg website and having abit of trouble openning file content to view on my phone. 

So here is how I go about it - if I upload a file with "public" access, then the file opens up on my phone, so i know Ive set everything up correctly, and its only a matter of being logged in.

Also, I understand  how to expose API functions, so from my iphone, I can make a post request to get auth_token... and then use that token to post to the wire or grab the number of new inbox messages or whatever...

Moreover, Ive created an exposed function that spits out the raw file data... and then maybe I can grab that data on the iphone side and reconstruct a file with it..... but I feel like its more complicated than it needs to be ...

Can I just keep a session alive somehow? on my iphone without browser cookies?

 

 

Thank you in advance and best regards,

Igor