Can I create app with out ui and running in foreground?
To avoid app to be killed when running in background and low resource.
Sorry for my english.
Thank you for any comment.
Check this BB tutorial - Create a Background Application.
Related
Can I do a background api call when the app is terminated/killed by the user in react native?
I tried with react-native-background-actions & react-native-background-timer.
Working fine in android but not in IOS when user terminate/kill the app
iOS have stricter policies about allowing background tasks to run when the app is killed, probably thats why you are facing this issue. Its not impossible to achieve what you are trying to, however its not very reliable, given that apple have full control of these tasks and when/if they are executed. You can try https://github.com/transistorsoft/react-native-background-fetch, its very well documented and might do the job for you.
I am working in iOS app Development .I am using
pkyeck/socket.IO-objc in my app to implement scoket connection. My Socket connections working well while the app running in foreground.but if my app goes to background the socket connections are stopped to work. please tell any suitable solutions to run app in background too. Thanks
This is in the project capabilities, it is called "Background mode" iirc. Here is a tutorial describing more details.
Basically, I suppose you want the "fetch" background mode.
https://www.captechconsulting.com/blogs/ios-7-tutorial-series-whats-new-in-background-multitasking
I am really stuck on this problem and I need your help! I'm doing an iPhone app.When iPhone swap between app and Facebook redirection in safari , iPhone shutdown the app for memory saving.
What I am doing is I am providing fb sharing in background from my app.
When I am doing fb sharing its shares successfully in background and comes back to my app successfully.At that time my app is not crashing. But when I go to safari and type Facebook and open fb site to check my shared post , in background my app is crashing.
This issue is coming in iPhone with iOS 7, I am not facing this issue in iOS 8.Check this post : Prevent IOS to shutdown an app when it app switch to facebook for login and permission request but this solution doesn't work for me as I am using pod to install fb and doing background share.
Though it's too late to answer this but I believe it may be helpful for others.
In App Programming Guide for iOS under "Being a Responsible Background App" section it was said that
your background running app would be terminated if it doesn't follow one of the given requirements.
You can familiarize with the full documentation. I'll quote 2 of them which exactly fit your problem:
Being a Responsible Background App
The foreground app always has precedence over background apps when it comes to the use of
system
resources and hardware. Apps running in the background need to be
prepared for this discrepancy and adjust their behavior when running
in the background. Specifically, apps moving to the background should
follow these guidelines:
Do not make any OpenGL ES calls from your code. You must not create an EAGLContext object or issue any OpenGL ES drawing commands
of any kind while running in the background. Using these calls causes
your app to be killed immediately. Apps must also ensure that any
previously submitted commands have completed before moving to the
background. For information about how to handle OpenGL ES when moving
to and from the background, see Implementing a Multitasking-aware
OpenGL ES Application in OpenGL ES Programming Guide.
Do minimal work while running in the background. The execution time given to background apps is more constrained than the amount of
time given to the foreground app. Apps that spend too much time
executing in the background can be throttled back by the system or
terminated.
To sum up, maybe your app is doing one of the above-given tasks when it's moved to the background after Facebook sharing.
If I have a service running in the background in my iOS app and someone kills the app (force closes) then the service does not restart automatically (I have not checked that but seems logical). Is there any way to have an app that does not allow the user to kill the service? Or that restarts the service automatically, even if the user kills it?
I do not think that you can, have a look at Apple's documentation.
Some apps are allowed to run in background, see part Background Execution and Multitasking of link above. It depends on what your app will do.
You can still ask for last-minute tasks when you'll enter in background, as you can see in the link above.
But anyway, once you are killed, it's over.
Hope it helps !
I would create an iOS application with geofencing.
Can I send a new list of geofencing points to this app through Apple Server in Background or must I launch the app to update its list of points ?
More easily, can I from an external server change the geofence point without launching the app ?
Thanks you very much.
Best regards
Assuming your app doesn't use any of the available background modes, you can't change them remotely. The push notifications are received and shown by the OS, and only opening them will trigger your app to load and execute your code.