<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: charismaaji</title>
    <description>The latest articles on DEV Community by charismaaji (@charismaaji).</description>
    <link>https://dev.to/charismaaji</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F791040%2F607a35ca-cbf8-4ae8-a052-314daf8189bc.jpeg</url>
      <title>DEV Community: charismaaji</title>
      <link>https://dev.to/charismaaji</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/charismaaji"/>
    <language>en</language>
    <item>
      <title>Setting up for connect fetching local API or http React Native IOS / MacOS</title>
      <dc:creator>charismaaji</dc:creator>
      <pubDate>Wed, 16 Feb 2022 10:00:42 +0000</pubDate>
      <link>https://dev.to/charismaaji/setting-up-for-connect-fetching-local-api-or-http-react-native-ios-macos-2pd8</link>
      <guid>https://dev.to/charismaaji/setting-up-for-connect-fetching-local-api-or-http-react-native-ios-macos-2pd8</guid>
      <description>&lt;p&gt;Some of you maybe got confused, why the API doesn’t work and get error when try to connect to local API or maybe http instead https.&lt;/p&gt;

&lt;p&gt;It because by default React Native cannot connect to API with http request, it's should be https&lt;/p&gt;

&lt;p&gt;To solve this problem, you need a bit setup on plist file&lt;/p&gt;

&lt;p&gt;first go to folder &lt;br&gt;
&lt;strong&gt;ios &amp;gt; {your file name} &amp;gt; info.plist&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;for example&lt;br&gt;
&lt;strong&gt;ios &amp;gt; FashionApp &amp;gt; info.plist&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;after that you copy this file&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;key&amp;gt;NSAppTransportSecurity&amp;lt;/key&amp;gt;
&amp;lt;dict&amp;gt;
     &amp;lt;key&amp;gt;NSExceptionDomains&amp;lt;/key&amp;gt;
     &amp;lt;dict&amp;gt;
         &amp;lt;key&amp;gt;NSExceptionAllowsInsecureHTTPLoads&amp;lt;/key&amp;gt;
         &amp;lt;true/&amp;gt;
     &amp;lt;key&amp;gt;localhost&amp;lt;/key&amp;gt;
     &amp;lt;dict&amp;gt;
         &amp;lt;key&amp;gt;NSExceptionAllowsInsecureHTTPLoads&amp;lt;/key&amp;gt;
         &amp;lt;true/&amp;gt;
     &amp;lt;/dict&amp;gt;
     &amp;lt;/dict&amp;gt;
     &amp;lt;key&amp;gt;NSAllowsArbitraryLoads&amp;lt;/key&amp;gt;
     &amp;lt;true/&amp;gt;
&amp;lt;/dict&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Block this section on plist file, and &lt;strong&gt;delete&lt;/strong&gt; it. After that, you &lt;strong&gt;paste&lt;/strong&gt; from your copying before&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdeqqw225cj2ecin7deir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdeqqw225cj2ecin7deir.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Success, now you can connect with http or local host without get any errors.&lt;br&gt;
If you have any question, feel free to ask me on&lt;br&gt;
email : &lt;a href="mailto:charismakurniawan@gmail.com"&gt;charismakurniawan@gmail.com&lt;/a&gt;&lt;br&gt;
instagram : charismaaji&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Setup environment React Native for MacOS M1</title>
      <dc:creator>charismaaji</dc:creator>
      <pubDate>Thu, 10 Feb 2022 10:44:26 +0000</pubDate>
      <link>https://dev.to/charismaaji/setup-environment-react-native-for-macos-m1-3jm3</link>
      <guid>https://dev.to/charismaaji/setup-environment-react-native-for-macos-m1-3jm3</guid>
      <description>&lt;p&gt;MacOs with chip M1 has different setup for environment React Native, some people got error and didn’t got any solution. In this article I will share to you how to setup React Native on MacOs M1&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Install Brew
&lt;/h2&gt;

&lt;p&gt;Open your terminal and copy this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If install finish, &lt;strong&gt;copy on the red line first&lt;/strong&gt; and press enter then &lt;strong&gt;copy on the blue line&lt;/strong&gt; and press enter&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewau86oco7kmq0birp98.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewau86oco7kmq0birp98.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Check brew version by&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you can see brew version, it's mean brew already installed  on your mac&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Install Node
&lt;/h2&gt;

&lt;p&gt;Back to terminal, and type this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install node
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check your node version by&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Install Watchman
&lt;/h2&gt;

&lt;p&gt;Now we need to install watchman&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install watchman
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Install Xcode
&lt;/h2&gt;

&lt;p&gt;Go to AppStore and install Xcode. It’s take a bit long time for installation because Xcode have a huge size. Wait until finish like this&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcc9qskjs9m7zh9d1lwrt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcc9qskjs9m7zh9d1lwrt.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you open Xcode it will show alert ask to install Rosetta. I’m not sure we actually need it. Let’s press &lt;strong&gt;NOT NOW&lt;/strong&gt; and we install as soon as we need.&lt;/p&gt;

&lt;p&gt;Now we open the Xcode and we go to preferences. You can see on this picture&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffz78rx0yl46wjk2dd22k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffz78rx0yl46wjk2dd22k.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to &lt;strong&gt;&lt;em&gt;locations&lt;/em&gt;&lt;/strong&gt; path and &lt;strong&gt;&lt;em&gt;click command line tools&lt;/em&gt;&lt;/strong&gt; let’s select &lt;strong&gt;&lt;em&gt;Xcode version&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  5. Set iOS simulator
&lt;/h2&gt;

&lt;p&gt;Now we need to install emulator or simulator by click &lt;strong&gt;Components&lt;/strong&gt; and choose emulator what we want to. It also take a bit long time because size a quite big. If installation was finish, it will look like this. Let's pick for iPhone 12 or 13&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj5ge8in54xbbe2e8qpue.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj5ge8in54xbbe2e8qpue.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  6. Install Ruby
&lt;/h2&gt;

&lt;p&gt;Install ruby by Open Terminal and copy this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install ruby
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  7. Install cocoapods
&lt;/h2&gt;

&lt;p&gt;install cocoapods by specify folders where we need to install, this is very important. So I would like to be&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo gem install -n /usr/local/bin ffi cocoapods
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now we can see our pod version by type this on terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pod --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Installation was finish. Now we can create new React Native project by type&lt;br&gt;
npx react-native init ExampleYourProject&lt;/p&gt;
&lt;h2&gt;
  
  
  (Add On) 8. If you still got error, follow this section. If not, you don’t need to follow this
&lt;/h2&gt;

&lt;p&gt;if you still got error, trying use this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo arch -arch x86_64 gem install cocoapods
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then copy this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo arch -arch x86_64 gem install ffi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then it’s possible to run it to your ios folder by going to your project and cd/ios and type this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;arch -arch x86_64 pod install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yey congratulations now you are already finish all React Native setup environment.&lt;br&gt;
If you have any question, feel free to ask me on&lt;br&gt;
email : &lt;strong&gt;&lt;a href="mailto:charismakurniawan@gmail.com"&gt;charismakurniawan@gmail.com&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
instagram : &lt;strong&gt;charismaaji&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>macbookm1</category>
      <category>m1</category>
      <category>macos</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>Create Responsive width and height in React Native</title>
      <dc:creator>charismaaji</dc:creator>
      <pubDate>Thu, 10 Feb 2022 10:23:27 +0000</pubDate>
      <link>https://dev.to/charismaaji/create-responsive-width-and-height-in-react-native-20n5</link>
      <guid>https://dev.to/charismaaji/create-responsive-width-and-height-in-react-native-20n5</guid>
      <description>&lt;p&gt;For Website or Mobile Developer sometimes width and height is a problem for different sizes of devices. To fix that problem, we need to create Responsive Size&lt;/p&gt;

&lt;p&gt;If you are using React Native, you can use this&lt;/p&gt;

&lt;p&gt;Usually for the first step I create folder utils and create index.js on utils folder.&lt;/p&gt;

&lt;p&gt;We need to &lt;br&gt;
import {Dimension} from 'react-native'&lt;/p&gt;

&lt;p&gt;Then we initiate for default height and width&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const heightMobileUI = 896;
const widthMobileUI = 414;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;after that we need to create function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const responsiveWidth = width =&amp;gt; {
  return (Dimensions.get('window').width * width) / widthMobileUI;
};

export const responsiveHeight = height =&amp;gt; {
  return (Dimensions.get('window').height * height) / heightMobileUI;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yep, we’re  finish for create responsive size! The question is, how can we use that?&lt;/p&gt;

&lt;p&gt;Here's step to using that, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import ResponsiveWidth from '../utils' 
// import same as location you create

&amp;lt;View style={{
width:responsiveWidth(100), 
height: responsiveWidth(100), 
backgroundColor:'red'}}&amp;gt;

      &amp;lt;Text&amp;gt; Example &amp;lt;/Text&amp;gt;

&amp;lt;/View&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yeayy now you already use for responsive size. You may ask why I use responsiveWidth on height? Because we use size base on width device, if device have different size it will different size also.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>javascript</category>
      <category>mobileapp</category>
    </item>
  </channel>
</rss>
