Have some know issue related to this?
When I open the app at first time, the requests is extremely fast, but if I leave the app in stand by for some seconds (~30 sec) and resume it, the requests take a lot of time to complete and sometime it can’t be resolved.
Some idea why this happen?
Thank you
Edit 1:
Actually, the slowness occur on page navigation and not on external requests. I need to navigate between pages 4~5 times to get the app running normally. The first time that I change page(after resume app) the loading take 30~40 sec to complete and this time is goes down until it normalizes.
What do you mean by “requests”? External requests? Loading of pages?
Did you remote debug the problem on the device already?
Follow these instructions here to debug the problem in Safari dev tools: Remote Debug your Ionic App · ionic.zone
Follow these instructions here to debug the problem in Chrome dev tools: Remote Debug your Ionic App · ionic.zone
Look at the console and network tabs for errors.
After debug I discover that the problem is on loading pages. Some external request is a bit slow too (~300ms) but page loading taking 30~40 secs to complete.
Ok, let me try to explain…
When I pause the app and leave it inactive for 15 minutes for example, and after try to resume, the app opens in the same page I was, ok… But, if I navigate to another page, the time to load is about 30~40 seconds to complete. External request doesn’t have any impact about this time.
I think I got it now: After you resume your app, navigating to a different page in your app is very slow. Correct?
How do you navigate to pages in your code?
Anything special about these pages?
Can you replicate the problem with a new project created with e.g. ionic start test tabs?
What is your ionic info output?
After some tests, I think the only way is to reload the app when user resumes it.
How can I force app to reload?
I’ll implement a function that verify the time that user app is paused and when the app is resumed, checks if the paused time is bigger than 10 minutes, for then to call reload function.
If you really want to implement something like that, please create a new topic and ask there.
But I really suggest you find out why this is happening. It is definitely not normal.
(First step would be to answer the questions from my previous post)
All pages makes external requests every time they are called, and I setup to make requests on ionViewWillEnter()
I have a loop that run each 4 seconds to update certain info that I need to keep up to date. I tried to pause this loop when app is paused and resume it when app is resumed, but this doesn’t solve my problem. The loop is called on app.component.
Unfortunately(or not) I can’t
global packages:
@ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.1
Ionic CLI : 3.4.0
local packages:
@ionic/app-scripts : 1.0.0
@ionic/cli-plugin-cordova : 1.4.1
@ionic/cli-plugin-ionic-angular : 1.3.2
Cordova Platforms : android 6.2.3 ios 4.2.0
Ionic Framework : ionic-angular 2.0.0
System:
Node : v7.10.0
OS : OS X El Capitan
Xcode : Xcode 7.3.1 Build version 7D1014
ios-deploy : 1.9.1
ios-sim : not installed
npm : 4.2.0