IOS App suspended automatically - ios

I have a problem in my release iOS app...
When i use my app and through all of feature (Like to another view in my app etc) in my app and then i click home button in ios to switch in to another app then i switch back to my app. My latest state (View) still exist. However, when i switch in to another app for a while, my app restarting from splash screen.
Another problem when i am trying to detect the problem in my ios simulator, the problem i have in the release app could not appear in my ios simulator.
Any people here could give me a solution to fix my problem ?
If the problem i have in memory usage, how many memory usage can be tolerated by IOS system ? and how can i know from ios simulator that memory usage is greater than the limit ?
additional info : my iOS app is based on objective-c and mixing with swift code. I use XCODE 8 and my app not using background service like download video, music, and etc. However, i use nsurlsession to fetch data from server and using data from server to load image from server. I use sdwebimage to handle image.
I hope this picture can give another insight about my app. This picture i take when my position in home of IOS, not in my app

It probably is memory usage. The job of the WatchDog process is to look for suspended memory hogs and kill them. You appear to be one.
You can readily see in Xcode how much memory you were using when you went into the background. How much was it? If it's a lot, don't do that. It's your job to release as much memory as you can when you go into the background, for this very reason.
However, your app can never hope to live forever — sooner or later, it will be killed in the background — so another responsibility you have is to save its state and, if you are launched from scratch, restore that state. That's just how iOS works.

Related

In iOS 11.2, opening forcefully closed apps, sometimes shows the previously visible view and redirect to the launch screen

In iOS 11.2 application I have noticed an unusual behaviour (opening forcefully closed apps, sometimes shows the previously visible view and redirect to the launch screen), I don't know whether it is bug with OS or something else but it can sometime appear in Google app also.
You can find the related video in below link.
https://s3.amazonaws.com/uploads.hipchat.com/37040/3355524/7K3EL8N5X55tN8p/ScreenRecording_12-13-2017%2013%3A23.MP4.
Please help me to figure it out whether it is a feature or bug.
In my opinion, it's rather a bug or just normal behaviour, not a feature. There is some time before the app is dropped from the RAM, used to save some data, e.g. in appWillTerminate, etc., but it should not make an effect like you have observed. From the second hand, maybe device holds the image of how app looks like before the rage quit and shows it up, then freshly opens the app.

iOS Swift - Prevent OS from killing app in background mode?

I've created an app that takes in bluetooth data from a local device and uploads it to a database. I'd like to be able to keep doing this indefinitely when the app is pushed to the background or if the phone is put into lock/sleep mode.
I've edited Plist info to allow CoreBlueTooth and network content to be enabled while in background mode. Using this and a couple memory saving tweaks for when the app gets pushed into the background, I'm able to hit just under 4 hours of operation when the app is pushed to background and the phone is put to lock/sleep. However, after 4 hours the phone seems to automatically terminate the app completely (while being at over 80% battery life).
Is there any way to prevent iOS from terminating suspended apps and ensure that they run indefinitely (until battery runs out)?
Thanks!

Xamarin - iOS backgrounding with BT low Energy and TTS

I'm working on a proof of concept app. I'm using Xamarin for iOS. The iPhone app runs in the background and watches for particular BTLE devices and speaks using TTS when the signal is at a certain strength. I have TTS working and I can recognize the BTLE devices when the app is in the foreground.
However, I'm having trouble getting either working when the iPhone screen is off. In Android, I'd just use a wake lock, but that appears to not be available in iOS. I tried setting the background modes in the info.plist file for BTLE and sound, but I don't see any processing happen while the unit is suspended. Can anyone point me in the right direction?
This is just a proof of concept, so I'm only looking at the latest iOS version and I'm interested in even hacky answers.
Thanks!
You will need to create at least one background task UIApplication.SharedApplication.BeginBackgroundTask and end it with EndBackgroundTask when you finish transferring your data.
Note that you will have approximately 10 minutes in background. If user switch back to the app the time will be reset.
You might also want to disable application idle timer to prevent the screen to go black when the user doesnt touch it.

App stays in splash screen in iOS 7.0.3

Recently in iOS 7.0.3, my app stays in the splash screen and was not going into the app at all.
If i kill the app and launch it again it opens up without any issues.
Can anyone help me on this issue?. I think the application -didFinishLaunchingWithOptions was not returning yes.
Note: I have a lot of stuffs like deleting database, initializing a dozen of buttons in appdelegate init function.
I know that it is a bad practice to have things in init but since its been there for more than 4 years and was working fine with previous OS versions i didn't find a good reason to change it.
Also this issue is not happening all the time.
My app size is 40 MB.
The iOS Guidelines say that you should not include anything which holds the Splash screen for much time its better if you do all the process in background so that splash screens loads up and user can play with app. But as you said your issue is not all the time so Try to reset the app and also quit simulator. Hope this helps.

Cocos2d game doesnt launch on some devices

I're released an iPad game which is developed on the Cocos2d framework. Ive tested the game on a number of devices iPad 3, and iPad 2 and never had any issues.
Now i'm getting a few reports back that its not launching properly on some devices. People are saying they are seeing the default.png images then the app is closing.
Any ideas?
Without crash report this is just a guessing game.
By all means try to reproduce the problem on your side.
Possible problems:
1. If the app takes too long to launch it will be closed by iOS.
2. If it does not have enough memory it will not launch as well.
Try the following:
I. Open many other heavy apps in the background so there is not much memory.
See how it affects your app launch.
II. During launch try to use as many fast taps as possible and fast gestures.
There is possibility that very early taps are not serviced properly or at all
and that can cause the crash.
III. Test on many devices as you can - especially low end.
I found the issue, it was to do with the social framework running on older devices where it isn't available.

Resources