Page 1 of 2

Refreshing data not working on devices - works in browser.

Posted: Thu Jun 23, 2016 3:25 pm
by Chris6743166

I have a service which retrieves JSON data from a url. The service works fine when the service is called for the first time in all environments.

However, when I try to refresh the data on a device it fails to refresh. This happens with the appery tester and compiled app, but not with the browser tester. The app has to be fully closed and reopened for the data to be refreshed.

This is the app (shared with support):
1d3c218b-8aa3-4f21-8144-c957539b701d

This is the json url where I'm getting the data:
http://schoolsays.co.uk/schools/broal...

Here's screenshot of the weiner network tab for the compiled app:
Image

Can you help me solve this issue? It's only just come to light and the app is live.

Many thanks,

Chris


Refreshing data not working on devices - works in browser.

Posted: Thu Jun 23, 2016 6:45 pm
by Chris6743166

I should add that this problem appears to have arisen following the upgrade to libraries version 3.1. Previous version of the same app do not have the issue.

This is the javascript I'm running to refresh the page and it's data (on news.html):

prejQuery.mobile.pageContainer.pagecontainer('change', 'news.html', {
allowSamePageTransition: false,
transition: 'none',
reload: true
});/pre


Refreshing data not working on devices - works in browser.

Posted: Fri Jun 24, 2016 8:28 am
by Serhii Kulibaba

Hello Chris,

You don't need to refresh the page each time you need to update it's data. Please run the JS function or any another action (Execute service, mapping, set Storage variable, etc.) instead.

It works much faster than simple refreshing the page.


Refreshing data not working on devices - works in browser.

Posted: Fri Jun 24, 2016 8:51 am
by Chris6743166

Hi Sergiy,

Thanks for the reply. I've tried what you suggest and the result is the same. I've replaced the above page refresh with the following call to execute the service:

preget_news_data.execute({
data: {
"count": post_count
}
});/pre

This is the same service which successfully populates the page on load, but the data isn't updating on subsequent service execution.

Your continued help with this matter would be greatly appreciated.

Thanks,

Chris


Refreshing data not working on devices - works in browser.

Posted: Mon Jun 27, 2016 6:49 pm
by Serhii Kulibaba

Please check if there are any errors in the browser console. You can learn here: https://devcenter.appery.io/documenta... how to open the console.


Refreshing data not working on devices - works in browser.

Posted: Mon Jun 27, 2016 8:37 pm
by Chris6743166

Hi Sergiy,

As I mentioned previously, there is no problem when run on a browser. However, I had previously checked for errors in the browser console. The only issue was the usual warning:

preSynchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/./pre

Otherwise, no errors.

The problem only occurs when run on a compiled app or appery tester. I've tried using the Weinre debugging, but nothing shows up.

I'd very much appreciate support from Appery on this. I have set the wordpress blog to auto post every five minutes so that the feed remains fresh. This will enable you to test on an app.

Thank you.

Chris


Refreshing data not working on devices - works in browser.

Posted: Mon Jun 27, 2016 9:26 pm
by Chris6743166

To reproduce the error, open the compiled app or in the appery tester (ios or android), click on 'News' button. Once loaded, wait 5 minutes and click the refresh button (top right).

You can confirm whether the feed has refreshed here: http://schoolsays.co.uk/schools/broal...

Thanks.


Refreshing data not working on devices - works in browser.

Posted: Wed Jun 29, 2016 2:54 pm
by Serhii Kulibaba

Don't you get any result from the http://schoolsays.co.uk/schools/broal... on mobile device?
Please add an alert to the success event of that servcie:
prealert(JSON.stringify(data));/pre to check these results


Refreshing data not working on devices - works in browser.

Posted: Wed Jun 29, 2016 6:47 pm
by Chris6743166

Hi Sergiy,

I've previously tried adding the above alert (and have just done so again) and it just confirms my problem: on a mobile device the data isn't being updated, while in a browser the data is being updated.

It's now almost a week since I reported this problem and would very much like it to be investigated from your end as I have three published apps with this issue.

Thank you.

Chris


Refreshing data not working on devices - works in browser.

Posted: Thu Jun 30, 2016 4:58 pm
by Serhii Kulibaba

Could you please provide us with exact steps to reproduce this issue/problem?