Headless JS - fix markdown typo.

Summary: Closes https://github.com/facebook/react-native/pull/10448

Differential Revision: D4039297

Pulled By: lacker

fbshipit-source-id: 21a398e3d35b2aa3d34cd35c865d36cf5a9e4b25
This commit is contained in:
Héctor Ramos 2016-10-18 14:33:05 -07:00 committed by Facebook Github Bot
parent d294e15c43
commit db474d95b4
1 changed files with 2 additions and 2 deletions

View File

@ -49,9 +49,9 @@ public class MyTaskService extends FbHeadlessJsTaskService {
}
```
Now, whenever you [start your service](https://developer.android.com/reference/android/content/Context.html#startService(android.content.Intent)), e.g. as a periodic task or in response to some system event / broadcast, JS will spin up, run your task, then spin down.
Now, whenever you [start your service](https://developer.android.com/reference/android/content/Context.html#startService(android.content.Intent), e.g. as a periodic task or in response to some system event / broadcast, JS will spin up, run your task, then spin down.
## 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.
* If you start your service from a BroadcastReceiver, make sure to call `HeadlessJsTaskService.acquireWakelockNow()` before returning from `onReceive()`.
* If you start your service from a `BroadcastReceiver`, make sure to call `HeadlessJsTaskService.acquireWakelockNow()` before returning from `onReceive()`.