<?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[Q's Adventure]]></title><description><![CDATA[Q's Adventure]]></description><link>https://blog.marqroldan.com</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 08:42:29 GMT</lastBuildDate><atom:link href="https://blog.marqroldan.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Making the app ring... a work in progress]]></title><description><![CDATA[Ever since I started working on a teleconsultation app, one of the great-to-haves (a.k.a. why do we still not have this yet?) is to make the app ring instead of asking people to wait inside. The app is built using React Native, so most of my knowledg...]]></description><link>https://blog.marqroldan.com/making-the-app-ring-a-work-in-progress</link><guid isPermaLink="true">https://blog.marqroldan.com/making-the-app-ring-a-work-in-progress</guid><category><![CDATA[Android]]></category><category><![CDATA[notifications]]></category><category><![CDATA[calls]]></category><category><![CDATA[incoming call]]></category><category><![CDATA[full screen activity]]></category><dc:creator><![CDATA[Marq Roldan]]></dc:creator><pubDate>Mon, 26 Jun 2023 22:27:45 GMT</pubDate><content:encoded><![CDATA[<p>Ever since I started working on a teleconsultation app, one of the great-to-haves (a.k.a. why do we still not have this yet?) is to make the app ring instead of asking people to wait inside. The app is built using React Native, so most of my knowledge was naturally JavaScript-centric. That is to say, my knowledge about the native side of things was not solid.</p>
<p>I dabble from time to time in the native world, usually to add features or fix deprecated code; I think it's safe to say that I can read code, and I am capable of googling things, therefore I can try things out and see if work or not. These were all easy fixes.</p>
<p>The app actually had a way to make itself appear to the user, but it's a method that only works for the lower versions of Android. It's now 2023, Android 10 was released 4 years ago, and with it, a lot of changes were introduced.</p>
<h3 id="heading-lets-just-go-to-the-exciting-part">Let's just go to the exciting part</h3>
<p><a target="_blank" href="https://notifee.app/">Notifee</a> was the notification package that replaced <a target="_blank" href="https://github.com/zo0r/react-native-push-notification"><code>react-native-push-notification</code></a>, the latter struggled with support and maintenance. Surprisingly, I never got to try <a target="_blank" href="https://github.com/wix/react-native-notifications"><code>react-native-notificaions</code></a>, not sure why.</p>
<p>So anyway, with Notifee you can add a <code>fullScreenAction</code> wherein you define the activity that you want to launch. If you're not familiar, then you should definitely read up what <a target="_blank" href="https://developer.android.com/guide/components/activities/intro-activities">Android Activities</a> are (note: I never read that page). In essence, I think you can just think of them as "screens" on Android similar to how you would have a screen using React Navigation.</p>
<p>Now, you need a few things set up first before you can have it working:</p>
<ol>
<li><p>You need to create an activity file—create the file as a sibling of MainActivity.java</p>
<pre><code class="lang-java"> <span class="hljs-comment">/// IncomingCallActivity.java</span>

 <span class="hljs-keyword">package</span> com.rnincomingcall;

 <span class="hljs-keyword">import</span> com.facebook.react.ReactActivity;

 <span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">IncomingCallActivity</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">ReactActivity</span> </span>{
   <span class="hljs-meta">@Override</span>
   <span class="hljs-function"><span class="hljs-keyword">protected</span> String <span class="hljs-title">getMainComponentName</span><span class="hljs-params">()</span> </span>{
     <span class="hljs-keyword">return</span> <span class="hljs-string">"incoming-call-activity"</span>;
   }
 }
</code></pre>
</li>
<li><p>Define that Activity in your Android Manifest</p>
<pre><code class="lang-xml">       <span class="hljs-tag">&lt;<span class="hljs-name">activity</span>
               <span class="hljs-attr">android:name</span>=<span class="hljs-string">"com.rnincomingcall.IncomingCallActivity"</span>
               <span class="hljs-attr">android:showWhenLocked</span>=<span class="hljs-string">"true"</span>
               <span class="hljs-attr">android:turnScreenOn</span>=<span class="hljs-string">"true"</span>
               <span class="hljs-attr">android:launchMode</span>=<span class="hljs-string">"singleTop"</span>
               <span class="hljs-attr">android:showOnLockScreen</span>=<span class="hljs-string">"true"</span>
               <span class="hljs-attr">android:exported</span>=<span class="hljs-string">"false"</span>
       /&gt;</span>
</code></pre>
<pre><code class="lang-xml"> <span class="hljs-comment">&lt;!-- Don't forget to add these permissions! --&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">uses-permission</span> <span class="hljs-attr">android:name</span>=<span class="hljs-string">"android.permission.USE_FULL_SCREEN_INTENT"</span> /&gt;</span>
     <span class="hljs-comment">&lt;!-- Xiaomi and similar devices overlay configs --&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">uses-permission</span> <span class="hljs-attr">android:name</span>=<span class="hljs-string">"android.permission.ACTION_MANAGE_OVERLAY_PERMISSION"</span> /&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">uses-permission</span> <span class="hljs-attr">android:name</span>=<span class="hljs-string">"android.permission.SYSTEM_ALERT_WINDOW"</span> /&gt;</span>
</code></pre>
</li>
<li><p>Register that component on React Native—like a typical react/screen component. Make sure to have it in your <code>index.js</code></p>
<pre><code class="lang-typescript"> <span class="hljs-comment">/// Activity_IncomingCallScreen is a React Component</span>
 AppRegistry.registerComponent(
   <span class="hljs-string">'incoming-call-activity'</span>,
   <span class="hljs-function">() =&gt;</span> Activity_IncomingCallScreen,
 );
</code></pre>
</li>
</ol>
<p>When you have everything correctly set-up (including Notifee example), you should be able to see your component show up when you press the notification</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687818240984/62a824d7-f548-4ac8-8e0e-2fe4644c1245.png?height=300" alt class="image--center mx-auto" /></p>
<p>Check out the repository below if you want to just test it out (note that it's a work in progress, so files are moving on the main branch)</p>
<p>I shall be back for part 2... when I finally get what I wanted (i.e. passing data, launching different components etc)</p>
<h3 id="heading-repository">Repository</h3>
<p><a target="_blank" href="https://github.com/marqroldan/react-native-incoming-call">https://github.com/marqroldan/react-native-incoming-call</a></p>
]]></content:encoded></item><item><title><![CDATA[Hi, Hello | Welcome to my blog]]></title><description><![CDATA[This blog is going to be for my journey in the tech world. And as a means to practice my writing skillz.
So, most of the time what I will be posting are in-progress articles as I explore more about the end goal that I want.
If you want to reach me, I...]]></description><link>https://blog.marqroldan.com/hi-hello-welcome-to-my-blog</link><guid isPermaLink="true">https://blog.marqroldan.com/hi-hello-welcome-to-my-blog</guid><dc:creator><![CDATA[Marq Roldan]]></dc:creator><pubDate>Mon, 26 Jun 2023 21:40:57 GMT</pubDate><content:encoded><![CDATA[<p>This blog is going to be for my journey in the tech world. And as a means to practice my writing skillz.</p>
<p>So, most of the time what I will be posting are in-progress articles as I explore more about the end goal that I want.</p>
<p>If you want to reach me, I have my socials up on the header bar</p>
<p>Enjoy your stay! :D</p>
]]></content:encoded></item></channel></rss>