title: Implement unstoppable background service in react native
body: <p>I am trying to run a unstoppable background service in react native which will continuously listen for messages via Socket.io from server.</p>
  
  <p>For this I found several solutions with several problems</p>
  
  <ol>
  <li><strong>Use FCM</strong>
  
  <blockquote>
    <p>The problem with method is that first I have to listen for FCM event than connect to my server and get the data(Messages + images + Videos). And I don't want to use firebase for my app as its expensive and don't want to store my user data (Mainly images) and handle user auth.</p>
  </blockquote></li>
  <li><strong>Use <a href="https://github.com/transistorsoft/react-native-background-fetch/" rel="nofollow noreferrer">react-native-background-fetch</a></strong>
  
  <blockquote>
    <p>This thing is pretty good but it only allow to run single job every 5 minutes and if your service is killed by android than you are gone</p>
  </blockquote></li>
  <li><strong>Use <a href="https://facebook.github.io/react-native/docs/headless-js-android" rel="nofollow noreferrer">Headless JS</a></strong>
  
  <blockquote>
    <p>To be honest I cannot understand its documentation</p>
  </blockquote></li>
  </ol>
  
  <p>Please tell me what to s I am confused and amazed that there is no proper way to handle this
  TIA
  regards</p>