Add note to add the service to AndroidManifest

Summary:
If not you will try to start the service but nothing would happen

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/14813

Differential Revision: D5384460

Pulled By: hramos

fbshipit-source-id: 6131d7901d3324da97672141c4774b7810051526
This commit is contained in:
LironErman 2017-07-07 15:15:56 -07:00 коммит произвёл Facebook Github Bot
Родитель 9afb71fde8
Коммит 6db97d638d
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -52,6 +52,12 @@ public class MyTaskService extends HeadlessJsTaskService {
Now, whenever you [start your service][0], e.g. as a periodic task or in response to some system event / broadcast, JS will spin up, run your task, then spin down.
Remember to add the service to your `AndroidManifest` file:
```
<service android:name="com.example.MyTaskService" />
```
## Caveats
* By default, your app will crash if you try to run a task while the app is in the foreground. This is to prevent developers from shooting themselves in the foot by doing a lot of work in a task and slowing the UI. There is a way around this.