Prevent app from being killed in background by iOS Camera app - ios

I have an GPS-Tracking-Fitness-App where the user can track workouts in the background. All of that is working fine. No problem.
But SOME users - not many, but some - have the problem, that opening the camera app on their phones will kill my app.
I can't reproduce it on my phone, but I once had such a phone in handy for debugging, and in the Xcode memory-debugger I could see that opening the camera-app there took about 2-3 GB!!! of ram and my app instantly got a low-memory-warning and was then killed.
I guess my app can't really do something about that?!? It does not use that much RAM itself. So I am wondering if I can somehow prevent that. I guess I did not miss any "background-mode : super-important-to-the-user" or so setting? :)
Or is there a way to at least trigger a Push-Notification in such case? Not sure...
Any help would be greatly appreciated!

Related

React-native app whitescreen when in background for a longer time

Short description of our situation:
We have a react-native application which renders a website with react-native-webview (https://github.com/react-native-webview/react-native-webview)
Whenever our application is in the background for a longer time (mostly occures over night), the application results in a whitescreen when opening up the next day. This only really occures on iPhones - not on android devices / nor on iPads.
When the application goes to the background, we stop all polling tasks and the app isn't really doing anything till it comes to the foreground again.
Does anyone have an idea what could cause this problem? Is this a general problem on iPhones with webviews?
We have a possible fix by really disabling the webview, when the app goes to the background (by not rendering the Webview once the appState goes to background). Still would be interesting to know where this comes from.
I'm thankful for any help!
Have a nice day.
I found this information with a possible solution: https://blog.embrace.io/bug-of-the-month-blank-webviews/
They occur when web views fail or are killed by the OS. Normally, a process being killed would crash the application, but on iOS, WKWebViews have two additional processes: a content process and a networking process. These can be killed without affecting the main application process. You can provide a better user experience by deciding which web views should be reloaded upon failure and adding this functionality through the webViewWebContentProcessDidTerminate callback on WKNavigationDelegate.
Haven't tried it out yet - but will.

Debugging ios geofence intermittent issue

We have an app which is monitoring one location. Lately we have noticed that sometimes, ios app doesn't send notification for enter. Things are working fine with android app.
I was reading up on the documentation and the only litmition i found is that an app can only track 20 locations. Which isn't the case in our app. We are tracking only 1 location.
I also looked into if the app has proper implementation and it does, thats why we get notifications sometimes and sometimes we don't.
The other thing that i could think of is if the cell phone was in Low Power Mode. That's one pointer for me so far.
Is there anything else that i could look into to figure out the issue?

Can throwing the iPhone high in the air launch my app or trigger desired function in iOS 7 or later

My app is an emergency app. It will be used by people in emergency and disasters.
It's possible that they got stuck in situations where they just don't have the time to enter or draw their password on the lock screen, launch the app and push a button. Is it possible that my app can ask the OS to launch the app if user throw their iPhone up in the air or shake it vigorously or something else.
What I wish to achieve by this ?
I want that OS launches my app in background if the user say shake his/her iPhone vigorously. Once launched my app will make a network request and keep running in background for short time.
PS:I think it's possible with the accelerometer.
Accelerometer will not work because Apple doesn't allow background processes opening apps. In your case, user must be opening the app by himself/herself manually. (PS. As far as I know, it's possible in Android)
iOS background tasking problems aside:
Apple don't allow apps that encourage the user to do things that might damage their iOS device. So your 'throw in the air' idea is out.
As for shaking the device -- this just isn't practical. What if the device gets shaken by accident? You've then got false alarms to deal with.
The crux of the issue is that something that triggers an emergency response should be a deliberate action which is hard to do trigger by accident.
This cannot work - and here's why.
Your app would need to run in background to handle motion events. Apps running in background can get killed at any time, i.e. if memory gets low. There might be some restrictions about running and and resource usage as well.
An app in the background cannot bring itself to the front.
Launching from a locked screen would bring great security risks.
Throwing into the air seems like a gesture that can easily be triggered by accident.
I must admit that I'm pretty happy that those apps are not allowed on the AppStore - as it would open many doors that I'd like to see kept close.

App audio no longer working after a few days in the background

My iOS app is an audio-led app. If I leave the app and leave multitasking on, I'm finding that if I return after a few days, it happily puts me back in the place in the app that I was, but all audio no longer works. There is no problem if I only leave it a few hours.
It has done this lots, and I have no idea how to reproduce it. I've solved the problem for now by turning multitasking off, which is obviously not ideal. However, this means that the audio gets a full reboot each time and doesn't render the app utterly useless!
Sorry for the vagueness, I'm a little stuck. Things I've tried: making sure all audio is released on transition of app to background, and allowing audio to run in the background (this does something else)
Ideas?
One solution, though not tackling the problem, would be to only allow the app to run in the background for a few hours - does anybody have an idea how to do this?

Iphone running out of battery kills app

I'm close to completing my first app and I just discovered a potentially devastating issue. When the battery ran out on my iPhone my app would not open after recharge. Whatever happened, it appears to have been fatal. I was able to recreate the error on another iPhone as well.
Can anyone help me? I have found very little about this on the internet.
I seems to me that you store some data for your app on the device. And this data is in incorrect state after the recharge. Try to figure it out and rewrite data saving code.

Resources