Browse files

Add note to add the service to AndroidManifest

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 to learn more about contributing to React Native.

Happy contributing!
Closes #14813

Differential Revision: D5384460

Pulled By: hramos

fbshipit-source-id: 6131d7901d3324da97672141c4774b7810051526
  • Loading branch information...
LironErman authored and facebook-github-bot committed Jul 7, 2017
1 parent 9afb71f commit 6db97d638d5562fa69a44516b75ed80bbef97de9
Showing with 6 additions and 0 deletions.
  1. +6 −0 docs/
@@ -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.

0 comments on commit 6db97d6

Please sign in to comment.