title: How to get push notifications on react-native App?
body: <p>I have made a mobile app using react-native (only android for now and it is not an expo app) and I would like to add push notifications to this app. The app is some kind of a social media and when the user is on scrolling the "news feed" the mobile app makes each 3 seconds a request on the server to see if there is a new notification. </p>
  
  <p>On the server is a Ruby on Rails web-app that has a small dashboard so the admin can block misbehaving users and there are some API controllers that return JSON-s for the mobile app. 
  So the mobile app will make a request to the notifications controller and if there are any new notifications user will see them on the react-native mobile app. 
  When the mobile app is closed and there is a new notification on the server the user won't see it until the mobile app is active and can make requests to the notifications controller. </p>
  
  <p>Is there some way to notify the user when the app is closed?  I found this service:
  <a href="https://github.com/geektimecoil/react-native-onesignal" rel="nofollow noreferrer">https://github.com/geektimecoil/react-native-onesignal</a></p>
  
  <p>At this time I'm not using Firebase but if I  have understood it correctly I will  somehow need to send the new notification that is created in my Ruby on Rails web-application to the Firebase service and then will Onesignal  service get it from Firebase and display it as a push notification on the users smartphone even if the mobile application is closed? </p>
  
  <p>Have I understood it correctly? Is there some easier way to achive my goal or some good tutorial that will help me to implement it like described?   </p>