Page 2 of 2

Refreshing data not working on devices - works in browser.

Posted: Thu Jun 30, 2016 6:40 pm
by Chris6743166

To reproduce the error, do the following:

  1. Check the id of the first post in the JSON feed:
    http://schoolsays.co.uk/schools/broal...

  2. Open the app (compiled app or in Appery tester) and click on 'News' button (bottom left).

  3. Once loaded, wait 5 minutes and then check the id of the first post in the JSON feed again to confirm it has updated.

  4. Once you are sure the feed has updated, click the refresh button on the app (top right).

    You should see that, despite the fact that the JSON feed has updated, the data in the app is not refreshing.


Refreshing data not working on devices - works in browser.

Posted: Fri Jul 01, 2016 3:34 pm
by Serhii Kulibaba

The problem is related with jsonp request. You use jsonp, which is updated automatically, but the application sees it's previous value, because the URL is not changed, to it reads data from cache.

Please add a time-related parameter to that service, e.g. timestamp, so your URL will be:
prehttp://schoolsays.co.uk/schools/{id}/api/get_posts/?timestamp=1467387152666/pre

do do that, please add a request parameter timestamp to that service, and add

codetimestamp: new Date().getTime()/code to the execude method


Refreshing data not working on devices - works in browser.

Posted: Fri Jul 01, 2016 3:50 pm
by Chris6743166

Hi Sergiy,

Thanks for that. Your solution works.

I have published many identical apps using JSONP without the timestamp and they refresh without problem. Why wasn't this an issue previously?

Chris


Refreshing data not working on devices - works in browser.

Posted: Fri Jul 01, 2016 6:24 pm
by Serhii Kulibaba

Did you publish Cordova applications, built by Appery.io? If so - what libraries version did you use there? Do they have the same type of URLs?


Refreshing data not working on devices - works in browser.

Posted: Fri Jul 01, 2016 7:11 pm
by Chris6743166

Yes, identical Cordova apps built with Appery. Same URLs. Only difference is they used libraries v3.0 (instead of v3.1).


Refreshing data not working on devices - works in browser.

Posted: Mon Jul 04, 2016 7:29 am
by Serhii Kulibaba

Could you change library of the last your app to 3.0 and check it again?


Refreshing data not working on devices - works in browser.

Posted: Mon Jul 04, 2016 8:42 am
by Chris6743166

Hi Sergiy,

I tried changing the libraries back to 3.0 last week and it didn't help. Also, I have since discovered that one of the problem apps was already using libraries 3.0 and still displayed the same problem, so I don't think that was an issue with the libraries.

If it is useful to know, the three affected apps were all created using the same 'School App' plugin (the previous version of the plugin with the same name on my account)

Anyway, your solution works, so perhaps we should consider this thread closed, unless you see value in continuing to investigate.

Thanks for your help.

Chris