Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Anything where you need to stay alive in the background and periodically do something.


Utterly false. Staying alive has nothing to do with React Native or Cordova or any particular framework. It's about implementing the native APIs that allow that behaviour.

I'm the author of a couple of modules that allow your RN app to operate in the background:

https://github.com/transistorsoft/react-native-background-fe...

https://github.com/transistorsoft/react-native-background-ge...

Both of these modules were ported from Cordova and have since been ported to NativeScript.


Thank you for linking those modules. I'm in the early stages of an app that will benefit from that functionality and admittedly my knowledge is based off of the first google result of a search for "react native background worker/task" (http://stackoverflow.com/questions/35376690/how-can-i-run-ba...). Which of course makes me an expert on the subject in this day and age.


So like a messaging app?


Uh no. Your application can be completely shut down and push notifications will still arrive on the phone for Android, iOS, and Windows Phone. Once the app is open, you load the new bits of the conversation.

Stuff in the background would be like video/audio calls, playing music, actively monitoring motion/gps (MapMyRun/Ride/Swim/etc), and a few other things that escape me at the moment.


On android at least, if you need to play music, couldn't you do that in a background service written Java and then have a UI written in RN that connects to that service?


Yes.


I have written an audio app in RN. I have no idea why you think it is not suitable for such use cases. I assume the OP was talking about games.


I actually meant more along the lines of if you already have 2 very successful iOS and Android apps and a process to release quickly and you've already found real meaningful traction. In this case, the cost of switching is probably not worth it versus continuously improving your existing apps.

If you are looking to release games quickly, the choice is generally Unity, although I hate how all the Unity games take forever to load, but it's a great way to get your game out quickly, and the good games will overcome the load times issue.


Is the app publicly available? I'd like to check it out




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: