Ionic 5 app unresponsive or freeze when maximize or notification drawer open in android - freeze

Getting strange issue for ionic 5 app,
Application works fine till it is in foreground.
Once application minimize and again maximize it is unresponsive , freeze on scroll , page routing are slow.
I have checked in logcat logs , it shows Skip 100 frames, Main thread doing too much work.
but app is just come back to foreground nothing changed.
also shows error activityResumeTrigger: not whiteListed /mainactivity.
I am using ionic 5.4.16
Hope someone answer it,
Forget to mention , i have implemented AWS App SYnc, is that is reason of main thread doing lots of work when app resume.

Related

WorkManager not working when app killed in Android 10 although working fine till version 9 (Pie)

I figured out this issue when I wasnt getting the notification through workmanager when the app was killed from background tasks in Android 10.
It is working fine for all the android version till Andorid 9.
To test this, I run the app simultaneously on both 9 and 10 versions.
Is someone else also facing this issue? I searched the web but no support solution for Andorid 10 based issue.
Note: As soon as the app is opened and the workmanager is triggered,
I get the notification in 10 but not when the app is completely
closed. Also, I have tested this scenario on Google Pixel device as well for Android 10 but no success.
There is vast fragmentation in the android world. The background task management is the worst scenario as it will behave different in different devices. Please read the post below to get better understanding.
https://medium.com/mindorks/enable-background-services-in-chinese-roms-32e73dfba1a6
http://pguardiola.com/blog/darealfragmentation-alarms/

How to debug when my Ionic 4 app stop working?

A bit of context (I have been stuck on this for a few days now):
The first screen on my Ionic 4 app is the login page. Once I logged in successfully, everything works fine. Then, when I log out & log back in, the app just hangs. There is no error showing up on the console. So, my question here is, how can I debug to find out what is causing the app to hang half way using it?
*It hangs in browser mode and when it is running on android.
In order to debug your app step by step I recommend using chrome developer tools.
First you will have access to your source code, therefore you can put breakpoints at any position you want.
You can open this window by inspecting your page and selecting the source tap.
To locate the problem you should have an idea about Ionic Page Life Cycle
,
If none of the above works you still have the possibility to console log the code that you want to verify, also the template can cause such an issue if you have for example an infinite *ngFor or something that prevent the template from loading.

WatchOS app keeps crashing when being opened from remote notification

WatchOS app works normally if being opened from home screen. If I try to open it from remote notification screen (by tapping title label) two app behaviors can be spotted:
If application was loaded previously (I don't know how to name it, maybe better to tell that app is not killed by system or still present in memory). In this case application will load normally and do some action if asked (for example open some Interface Controller and show remote notification details).
If application was launched long time ago (or killed by system, unloaded from memory, in my case I'm stopping it in Xcode). If app receives remote notification in this state after tapping on title label of notification scene it will try to load for some time and finally crash (this may take 1sec or 1min). Or it will stuck with loading indicator shown - what is interesting that in this case if I'll try to attach watch extension process to Xcode debug it will show that app is launched and works (for example I can send some data from parent iOS app and watchOS app will receive it - triggered method in Extension delegate and do some stuff).
Googling I have found that watch apps can be killed by system if they take to much power when being launched, so I tried to remove any load while app is starting itself but with no success - it still keeps crashing.
The only close to mine situation that I've found so far was a topic in apple developers forum:
https://forums.developer.apple.com/thread/20553
I have been spotting the same logs like in topic when watching how watch app behave in Xcode/Devices, but after updating to WatchOS 3 (now 3.1 beta) and using new Xcode 8 (now 8.1 beta) I can't see any logs from WatchOS at all (just some system messages that watch screen was turned of and on).
Have any one spotted such issues while working with watchOS remote notifications? Any suggestion where to search for solution?

My iOS App Terminated due to Memory Pressure when I am using Photos.app

I am running my application on iOS 7.0.1 & iPod Touch 5th generation device. When I follow below steps my app quits with below error on Xcode 5 without any error in console
App quit Unexpectedly Terminated due to Memory Pressure
Steps:
1) Run my application using Xcode 5. Login & then go to Home
2) Click on Home button so that my app enters in background (I can see my app is in background)
3) Start inbuilt Photos app from iOS. Click 1 or 2 pictures
4) After taking 1-2 pictures , App quit Unexpectedly Terminated due to Memory Pressure
I am not doing anything in my app. When I checked the CPU usage its 0% & Memeory used = 15.2 MB
Also there is no other app running in the background except my app.
Can anybody help with this ? Thanks
I am not getting why this is happening. If I don't use Photos.app then app works smoothly.
There's nothing you can, or should, do about this. You application is no longer in the foreground, and the foreground app (photos) is asking for more memory. To supply this, iOS will terminate any apps running in the background. It doesn't matter how much memory your app is using, iOS will terminate background apps as long as the foreground app requires more memory.
Once your app enters the background you can expect it to be terminated at any time. To improve the user experience, you can look at Enabling State Preservation and Restoration in Your App. This in theory allows your app to start where it left off when the user comes back to it.

Background app crashing current app

I'm building an app that uses the camera. As many know, the camera uses a lot of memory and often throws a memory warning.
The app works well and as expected. However, when streaming Spotify in the background, my app crashes.
Is there any way to stop/pause a background app?
in iOS, every app runs in its own sandbox environment that cannot interact with other apps which are running so there is no way your app can pass on any kind of instruction (pause/stop) to other app running in background.