Thread in the background when the app is closed

Asked

Viewed 111 times

3

How do I run a Thread with the application closed? That is, so that when the user turns on the device it starts without having to enter the application.

  • Would the user like this? Would you like an app to devour your smartphone’s memory and cpu without being used? I think it is by no means a good practice and can lead your application to rejection when the user realizes that it is causing slowness and heating of the Hardware, and can be sure, the app user nowadays is more rigorous and demanding and attentive to these details... I do not advise you to do this, neither as a Developer nor as a user.

  • In android works this way, as well as applications that execute http requests, even the user being absent from the application these processes continue to be executed...

2 answers

3


Note: The answer is based on the fact that you mention the question you want the application to perform after the reboot of the device.

There’s only two ways to do that:

  1. Develop for devices jailbroken, and stay out of the Appstore.

  2. Your application is of the Voip type.

Background modes are quite limited on iOS, there’s not as much freedom as on Android.

1

Depending on your goal, Voce could use Silent Notifications. Of the manual Local and Remote Notification Programming Guide

The aps Dictionary can also contain the content-available Property. The content-available Property with a value of 1 Lets the remote notification Act as a "Silent" notification. When a Silent notification Arrives, iOS wakes up your app in the background so that you can get new data from your server or do background information Processing. Users aren’t told about the new or changed information that Results from a Silent notification, but they can find out about it the next time they open your app.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.