<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hon Jia Xuan on Medium]]></title>
        <description><![CDATA[Stories by Hon Jia Xuan on Medium]]></description>
        <link>https://medium.com/@hjaxuan?source=rss-911e752fd7ae------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Tkmd7I2-V6Km1VVs.</url>
            <title>Stories by Hon Jia Xuan on Medium</title>
            <link>https://medium.com/@hjaxuan?source=rss-911e752fd7ae------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 00:41:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hjaxuan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[react-native-firebase realtime database (Part 1)]]></title>
            <link>https://medium.com/@hjaxuan/react-native-firebase-realtime-database-part-1-a1997a3d901a?source=rss-911e752fd7ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1997a3d901a</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Hon Jia Xuan]]></dc:creator>
            <pubDate>Fri, 01 Jun 2018 08:03:38 GMT</pubDate>
            <atom:updated>2018-06-01T08:04:07.346Z</atom:updated>
            <content:encoded><![CDATA[<p>A very basic tutorial for those who need it.</p><p>react native version : 0.55.4</p><p>i am using <a href="https://github.com/invertase/react-native-firebase">react-native-firebase</a> to integrate with firebase.</p><blockquote>create a file `<em>constant.js`</em></blockquote><pre>export const FIREBASE_API_KEY = &lt;your API Key&gt;;</pre><pre>export const FIREBASE_AUTH_DOMAIN = &lt;your auth domain&gt;;</pre><pre>export const FIREBASE_DATABASE_URL = &lt;your url&gt;;</pre><pre>export const FIREBASE_PROJECT_ID = &lt;your id&gt;;</pre><pre>export const FIREBASE_STORAGE_BUCKET = &lt;your bucket&gt;;</pre><pre>export const FIREBASE_MESSAGING_SENDER_ID = &lt;your id&gt;;</pre><p>example:</p><pre>export const FIREBASE_API_KEY = &#39;sqhdushicqpdqjwpjqwjd&#39;;</pre><p>How to get all these info?</p><ol><li>go to <a href="http://console.firebase.google.com/">http://console.firebase.google.com/</a></li></ol><p>2. Click ‘Add Firebase to your web app’, then you will see the info above.</p><p>create another file, `firebase.js`</p><pre>import firebase from &#39;react-native-firebase&#39;;</pre><pre>import * as c from &quot;./constants&quot;;</pre><pre>// Initialize Firebase</pre><pre>const config = {</pre><pre>apiKey: c.FIREBASE_API_KEY,</pre><pre>authDomain: c.FIREBASE_AUTH_DOMAIN,</pre><pre>databaseURL: c.FIREBASE_DATABASE_URL,</pre><pre>projectId: c.FIREBASE_PROJECT_ID,</pre><pre>storageBucket: c.FIREBASE_STORAGE_BUCKET,</pre><pre>messagingSenderId: c.FIREBASE_MESSAGING_SENDER_ID</pre><pre>};</pre><pre>firebase.initializeApp(config);</pre><pre>export const database = firebase.database();</pre><pre>export const auth = firebase.auth();</pre><p>at the file you want to use firebase</p><pre>import * as firebase from &quot;./app/firebase.js&quot;;<br>const firebaseDatabase = firebase.database;</pre><p>to write data</p><pre>firebaseDatabase.ref(&#39;users/&#39; + &quot;1234567&quot;).set({</pre><pre>username: &quot;abcde&quot;,</pre><pre>email: &quot;hjdssd&quot;,</pre><pre>profile_picture : &quot;dhjakshka&quot;</pre><pre>});</pre><p>to read data</p><pre>firebaseDatabase.ref(&#39;users/1234567/username&#39;).on(&#39;value&#39;,function(snapshot){</pre><pre>Alert.alert(snapshot.val().toString());</pre><pre>});</pre><p>in code above, it will show an alert where the data from firebase as the alert content.</p><p>Feel free to ask any questions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1997a3d901a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>