<?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 Boyewa Richard on Medium]]></title>
        <description><![CDATA[Stories by Boyewa Richard on Medium]]></description>
        <link>https://medium.com/@boyewarichard?source=rss-e886457e2b2e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*pgONqVfxVmnO1BQD.</url>
            <title>Stories by Boyewa Richard on Medium</title>
            <link>https://medium.com/@boyewarichard?source=rss-e886457e2b2e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 14:52:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@boyewarichard/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[Fix for CORS Issue with Ionic 3 and above]]></title>
            <link>https://medium.com/@boyewarichard/fix-for-cors-issue-with-ionic-3-and-above-80e15aa7a551?source=rss-e886457e2b2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/80e15aa7a551</guid>
            <category><![CDATA[hybrid-app-development]]></category>
            <category><![CDATA[ionic4]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[ionic-framework]]></category>
            <category><![CDATA[ionic3]]></category>
            <dc:creator><![CDATA[Boyewa Richard]]></dc:creator>
            <pubDate>Wed, 16 Jan 2019 04:37:15 GMT</pubDate>
            <atom:updated>2019-01-16T04:37:15.710Z</atom:updated>
            <content:encoded><![CDATA[<p>There has been an issue with the new upgrade made by the Ionic team, you can read more about that <a href="https://blog.ionicframework.com/wkwebview-for-all-a-new-webview-for-ionic/">here</a>. It started like joke, the development was easy and smooth, testing was smooth on browser until I needed to test on real device, Android device to be specific. Even after all necessary headers were set on the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*nssbMkCHEInA-uFNGxZubA.png" /></figure><p><strong>Generally speaking, the best and recommended way of solving CORS issue is by specifying certain headers in response to preflight request made by the browser or client</strong>.</p><p>So, after several search for a working solution, I found out I was not the only one in this <em>ship. </em>Most solutions proposed online didn’t work for me (and for most people).</p><p>Since this seems to be a <a href="https://issues.apache.org/jira/browse/CB-10144">bug</a> in the interpretation of headers in the new WKWebView, a simple solution is just to send a content type with your request (if you must send, otherwise a default Content-Type is set to <strong>application/x-www-form-urlencoded</strong> or <strong>multipart/form-data</strong> as the case may be).</p><pre><strong>this</strong>.httpOptions = {<br>    headers: <strong>new </strong>HttpHeaders({<br>        &#39;Content-Type&#39;: &#39;application/x-www-form-urlencoded&#39;<br>    })<br>};</pre><p>With this, your requests are classified as <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests">simple requests</a> and will not require a preflight request to verify permitted <em>types or headers.</em></p><p>I hope this saves someone’s time somewhere.</p><p>You should read further about CORS and the security benefits on <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS">MDN</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80e15aa7a551" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AngularJS 4 HttpClient Pre-loader]]></title>
            <link>https://medium.com/@boyewarichard/angularjs-4-httpclient-pre-loader-b725931bcfc8?source=rss-e886457e2b2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b725931bcfc8</guid>
            <category><![CDATA[angular2]]></category>
            <category><![CDATA[angularjs-programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Boyewa Richard]]></dc:creator>
            <pubDate>Wed, 06 Dec 2017 02:57:43 GMT</pubDate>
            <atom:updated>2017-12-06T03:20:35.027Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/150/1*Kt7l5n_SqOz7d11MpqP3Qg.png" /></figure><p>Managing users’ experience during a pending Http request is very crucial in Single Page Apps. Since there is no visible change in the browser when asynchronous calls are made to the server, users are likely to get confused and eventually close your app out of frustration.</p><p>I have seen several articles online showing how to achieve this by extending HttpClient class. As much as this sounds like a nice solution, I believe its an over-kill.</p><p>So I came up with something different which I have done severally in Angular JS 1.x days. Write a simple interceptor that can intercept all calls made from the HttpClient. Then create a before and after methods to handle the departure and arrival of the flight :-).</p><p>So we need to create a file, I will call mine <em>app.interceptor.ts</em></p><pre><em>/**<br> * Created by akin.akindolani on 12/5/17.<br> */<br></em><strong>import </strong>{ Injectable } <strong>from </strong>&#39;@angular/core&#39;;<br><strong>import </strong>{<br>    HttpRequest,<br>    HttpHandler,<br>    HttpResponse,<br>    HttpEvent,<br>    HttpErrorResponse,<br>    HttpInterceptor<br>} <strong>from </strong>&#39;@angular/common/http&#39;;<br><strong>import </strong>{ Observable } <strong>from </strong>&#39;rxjs/Observable&#39;;<br><br><strong>declare var </strong>$:<strong>any</strong>;<br><br>@Injectable()<br><br><strong>export class </strong>AppInterceptor <strong>implements </strong>HttpInterceptor {<br>    <strong>constructor</strong>() {}<br>    intercept(request: HttpRequest&lt;<strong>any</strong>&gt;, next: HttpHandler): Observable&lt;HttpEvent&lt;<strong>any</strong>&gt;&gt; {<br>        <strong>this</strong>.showBusyLoader();<br>        <strong>return </strong>next.handle(request).do((event: HttpEvent&lt;<strong>any</strong>&gt;) =&gt; {<br>            <strong>if </strong>(event <strong>instanceof </strong>HttpResponse) {<br>                <strong>this</strong>.hideBusyLoader();<br>            }<br>        }, (error: <strong>any</strong>) =&gt; {<br>            <strong>if </strong>(error <strong>instanceof </strong>HttpErrorResponse) {<br>                <strong>this</strong>.hideBusyLoader();<br>            }<br>        });<br>    }<br><br>    showBusyLoader() {<br>        //Show Loader. <br>    }<br><br>    hideBusyLoader() {<br>        //Hide Loader<br>    }<br>}</pre><blockquote>Note that <strong>$ </strong>was declared. This means jQuery lovers can implement jQuery functions to fade in or out an element as the case may be.</blockquote><p>Next is to add this to our list of providers in <em>app.module.ts</em>.</p><pre><strong>import </strong>{ BrowserModule } <strong>from </strong>&#39;@angular/platform-browser&#39;;<br><strong>import </strong>{ NgModule, CUSTOM_ELEMENTS_SCHEMA,NO_ERRORS_SCHEMA } <strong>from </strong>&#39;@angular/core&#39;;<br><br><br><strong>import </strong>{ HTTP_INTERCEPTORS } <strong>from </strong>&#39;@angular/common/http&#39;;<br><br><strong>import </strong>{ AppInterceptor } <strong>from </strong>&#39;./app.interceptor&#39;;<br><br>@NgModule({<br>  schemas: [ CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA ],<br>  declarations: [...],<br>  imports: [...],<br>  <strong>providers: [{<br>    provide: HTTP_INTERCEPTORS,<br>    useClass: AppInterceptor,<br>    multi: true<br>  }]</strong>,<br>  bootstrap: [AppComponent]<br>})<br><strong>export class </strong>AppModule { }</pre><p>And that’s it. Run your app to see it in action.</p><p>Enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b725931bcfc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thanks a lot!]]></title>
            <link>https://medium.com/@boyewarichard/thanks-a-lot-e277042632a5?source=rss-e886457e2b2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e277042632a5</guid>
            <category><![CDATA[sunday]]></category>
            <category><![CDATA[humor]]></category>
            <category><![CDATA[grateful]]></category>
            <dc:creator><![CDATA[Boyewa Richard]]></dc:creator>
            <pubDate>Thu, 13 Apr 2017 06:23:37 GMT</pubDate>
            <atom:updated>2017-04-13T06:23:37.889Z</atom:updated>
            <content:encoded><![CDATA[<p>I just read this <a href="https://medium.com/@olatokunbofagbamigbe/it-takes-a-village-to-raise-good-software-engineers-cadb8430e7fd">piece</a> by <a href="https://medium.com/u/d4b63b2dd740">Olatokunbo Fagbamigbe</a></p><p>Thanks Olatokunbo Fagbamigbe. I was the first student mentored by Olatokunbo Fagbamigbe , Femi Oluwafemi , Niyi, Sunday. These guys are wonderful guys. Funny thing is that, they were all abroad when all of the mentoring was happening. They kept telling me “Richard keep learning, you are a smart guy” …. sincerely I don’t know how to thank them. Olatokunbo Fagbamigbe is not just a “Sayer” he is a “Doer”. I am glad I entrusted my career into their hands (Olatokunbo Fagbamigbe, Femi Oluwafemi, Niyi, Sunday, Bod Toki). I will follow them blindly any day any time. Thanks Bosses! I hail!</p><p>In return, they made me mentor other guys, and those guys have been doing the same, and gradually, spreading the knowledge we have to other folks.</p><p>PS: I am that silent guy preaching the Gospel of Javascript and initiating converts to a new world of endless possibilities</p><p>Going back to my cave….</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e277042632a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>