Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Headless JS tasks #251

Closed
stovmascript opened this issue Oct 26, 2016 · 4 comments
Closed

Headless JS tasks #251

stovmascript opened this issue Oct 26, 2016 · 4 comments
Labels

Comments

@stovmascript
Copy link

RN v0.36 added this feature and I'm wondering if it could be used for background and closed app notification handling, similar to what was added with #220 ...

@mikelambert
Copy link
Contributor

mikelambert commented Oct 26, 2016

It'd be good to clarify what benefits we expect headless JS tasks adding, feature-wise, that is not already available as part of #220 (Which I had written prior to JS tasks being released, and so works on older versions of RN)

One benefit is the simplification of code in this module, by using the 0.36 code instead. Turns out our codepaths are basically identical.. Though by making the feature 0.36-only, after just implementing it for everyone, people might complain. :P (ie, my app is not yet on 0.36)

Another potential benefit is mentioned in the docs:

 + * If you're starting a {@code HeadlessJsTaskService} from a {@code BroadcastReceiver} (e.g.
 + * handling push notifications), make sure to call {@link #acquireWakeLockNow} before returning from
 + * {@link BroadcastReceiver#onReceive}, to make sure the device doesn't go to sleep before the
 + * service is started.

...as my code in this module doesn't touch the wakelock (though we could reimplement that chunk of code too)

@chirag04
Copy link

chirag04 commented Dec 25, 2016

+1 for headless JS task. Not sure what is the min supported RN version is but 0.36 should be reasonable. Current RN release is 0.40.

@tmaly1980
Copy link

This is has been sitting idle for over a year, any idea whether this can be implemented? Android is having a bug where it's relaunching my app if the app is closed, when I'm using react-native-navigation. I need a way around that.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants