Page 1 of 2

Question about offline app

Posted: Sun Jun 07, 2015 11:06 pm
by sdanigo

Hi all,
I can read that the rest services support 'off line'. I'm just wondering if we have to manage this or if it is all pre-programmed.
I understand that the get, put, delete will be queued when offline and then process when online.
But what about the GET ? Do we have to 'pre-populate' local storage with data we are going to use ?
In my case, after login, users receive their work for the day from a database (basicaly, they receive addresses of client to visit, max of 10 client).
When they arrive at their client, they have to enter certain information associated to that client. All that is extract from a mySql server and is suppose to be updated live via their phone.
All the services , mapping, screens are done and all is working but I access directly my data and I don't know if it's a good strategy or if I'd better access my data and then create local storage and then map from that local storage.

Well, if someone could point me in the best strategy, it would be greatly appreciated.

Thanks

Sylvain


Question about offline app

Posted: Mon Jun 08, 2015 7:18 am
by Serhii Kulibaba

Hello Sylvain,

Do you mean API Express offline mode? https://devcenter.appery.io/documenta...

Simple REST services don't support offline mode


Question about offline app

Posted: Mon Jun 08, 2015 12:27 pm
by sdanigo

Hi Sergiy
Yes, I talk about Api express. (I have created my Rest Api via API express, and I have created rest service in my App by pasting the Rest service URL, as shown in the last tutorial video about API express)


Question about offline app

Posted: Mon Jun 08, 2015 2:57 pm
by Illya Stepanov

Hi Sylvain,

All GET requests will be taken from the app cache, so basically -- if such requests were made when the device was online, such requests will be replicated from cache when device goes offline.


Question about offline app

Posted: Tue Jun 09, 2015 1:22 am
by sdanigo

Hi,
so I've tested.
I was online and perform some queries.
Then I switch my phone to 'airplane mode' and, without leaving the app, try to perform same GET queries.
When I go on a page that invoke a service (GET, service invoked on pageShow event, servive made with APIExpress), even if that GET was already performed when I was online, I always have a blank page (no results) when I'm offline.

Is there something I'm not doing the right way here ?

Thanks

Sylvain


Question about offline app

Posted: Wed Jun 10, 2015 12:07 pm
by Serhii Kulibaba

Sylvain, GET requests don't work in offline mode:

When the client goes offline, all change-requests (POST, PUT, DELETE) to the server are going to be queued waiting to go online. (https://devcenter.appery.io/documenta...)


Question about offline app

Posted: Wed Jun 10, 2015 12:59 pm
by sdanigo

Hi Sergiy,
so what's the correct answer, yours or Illya's ?

Thanks

Sylvain


Question about offline app

Posted: Wed Jun 10, 2015 9:48 pm
by Illya Stepanov

Sylvain - And when you're back online are GET requests performing?


Question about offline app

Posted: Wed Jun 10, 2015 11:27 pm
by sdanigo

No, only the newset one


Question about offline app

Posted: Wed Jun 10, 2015 11:28 pm
by sdanigo

newest (not newset) :-)