Chris6743166
Posts: 1
Joined: Tue Mar 18, 2014 11:50 am

Refreshing data not working on devices - works in browser.

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

Chris6743166
Posts: 1
Joined: Tue Mar 18, 2014 11:50 am

Refreshing data not working on devices - works in browser.

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Refreshing data not working on devices - works in browser.

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.

Chris6743166
Posts: 1
Joined: Tue Mar 18, 2014 11:50 am

Refreshing data not working on devices - works in browser.

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Refreshing data not working on devices - works in browser.

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.

Chris6743166
Posts: 1
Joined: Tue Mar 18, 2014 11:50 am

Refreshing data not working on devices - works in browser.

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

Chris6743166
Posts: 1
Joined: Tue Mar 18, 2014 11:50 am

Refreshing data not working on devices - works in browser.

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.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Refreshing data not working on devices - works in browser.

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

Chris6743166
Posts: 1
Joined: Tue Mar 18, 2014 11:50 am

Refreshing data not working on devices - works in browser.

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Refreshing data not working on devices - works in browser.

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

Return to “Issues”