<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Integrating firebase in React Native App]]></title><description><![CDATA[Integrating firebase in React Native App]]></description><link>https://integrating-firebase-in-react-native-app.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 31 Aug 2026 00:52:40 GMT</lastBuildDate><atom:link href="https://integrating-firebase-in-react-native-app.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Push Notification for Android]]></title><description><![CDATA[Hi Everyone, Welcome back! Hope you all’re doing great.
Today, I’m going to tell you how you can add push notification feature in your react native application with firebase.
Steps:

Firstly, it requires firebase integration within your react native ...]]></description><link>https://integrating-firebase-in-react-native-app.hashnode.dev/push-notification-for-android</link><guid isPermaLink="true">https://integrating-firebase-in-react-native-app.hashnode.dev/push-notification-for-android</guid><dc:creator><![CDATA[Rashi Goel]]></dc:creator><pubDate>Tue, 16 Sep 2025 07:06:48 GMT</pubDate><content:encoded><![CDATA[<p>Hi Everyone, Welcome back! Hope you all’re doing great.</p>
<p>Today, I’m going to tell you how you can add push notification feature in your react native application with firebase.</p>
<p>Steps:</p>
<ol>
<li><p>Firstly, it requires firebase integration within your react native app. For same you can go through my previous article- <a target="_blank" href="https://push-notification-for-react-native-app.hashnode.dev/integration-firebase-with-react-native-project">https://push-notification-for-react-native-app.hashnode.dev/integration-firebase-with-react-native-project</a></p>
</li>
<li><p>Install messaging library within your project-</p>
<p> <strong>npm i @react-native-firebase/messaging</strong></p>
</li>
<li><p>For android permission to get notification-</p>
<pre><code class="lang-text"> import {PermissionsAndroid} from 'react-native';
   PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS);
</code></pre>
<p> Create a folder name with Notification under your project and create Notification.ts file and add permissions inside the same file-</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1753006214137/4242f32f-9915-4262-b2b3-9eec74573ec4.png" alt class="image--center mx-auto" /></p>
<ol start="5">
<li>Now to setup a background handler, call the <code>setBackgroundMessageHandler</code> outside of your application logic as early as possible:</li>
</ol>
</li>
</ol>
<pre><code class="lang-jsx">    <span class="hljs-comment">// index.js</span>
    <span class="hljs-keyword">import</span> { AppRegistry } <span class="hljs-keyword">from</span> <span class="hljs-string">'react-native'</span>;
    <span class="hljs-keyword">import</span> messaging <span class="hljs-keyword">from</span> <span class="hljs-string">'@react-native-firebase/messaging'</span>;
    <span class="hljs-keyword">import</span> App <span class="hljs-keyword">from</span> <span class="hljs-string">'./App'</span>;

    <span class="hljs-comment">// Register background handler</span>
    messaging().setBackgroundMessageHandler(<span class="hljs-keyword">async</span> remoteMessage =&gt; {
      <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Message handled in the background!'</span>, remoteMessage);
    });

    AppRegistry.registerComponent(<span class="hljs-string">'app'</span>, <span class="hljs-function">() =&gt;</span> App);
</code></pre>
<p>At last call useNotification method from your App.tsx file-</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1753006316768/5f96cae2-d55c-4b34-881d-dec540a01920.png" alt class="image--center mx-auto" /></p>
<p>The above steps are for notifications when app is not in use-</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1753006386282/b5ca3744-aec5-43d5-a6cb-021dffbbbfff.png" alt class="image--center mx-auto" /></p>
<p>Lastly, you can send notification from firebase→ cloud messaging and create your first campagin.</p>
<p>!! Congrats🎉🎉🎉 you have successfully added push notification feature in your application.</p>
]]></content:encoded></item></channel></rss>