<?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 Usamaijaz on Medium]]></title>
        <description><![CDATA[Stories by Usamaijaz on Medium]]></description>
        <link>https://medium.com/@usamaijaz912?source=rss-c6b96631220e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RyD4tQt1YFVZkK9_u9b5JQ.png</url>
            <title>Stories by Usamaijaz on Medium</title>
            <link>https://medium.com/@usamaijaz912?source=rss-c6b96631220e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 03:41:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@usamaijaz912/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[ Build a CI/CD Workflow for Your React Native App Using GitHub Actions]]></title>
            <link>https://medium.com/@usamaijaz912/build-a-ci-cd-workflow-for-your-react-native-app-using-github-actions-e660d0112520?source=rss-c6b96631220e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e660d0112520</guid>
            <category><![CDATA[fastlane]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Usamaijaz]]></dc:creator>
            <pubDate>Sun, 30 Nov 2025 10:20:49 GMT</pubDate>
            <atom:updated>2025-12-01T14:40:49.692Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Devs 👋, Are you tired of <strong>spending hours waiting for React Native builds</strong> to complete on your local machine? I was too. Keeping my laptop on and connected just to build apps was slowing down my productivity.</p><p>In this tutorial, you will learn <strong>step by step how to set up a CI/CD workflow for your React Native app using GitHub Actions</strong>. This will:</p><p>✅ Automate version management<br>✅ Free your machine from heavy build processes<br>✅ Enable <strong>consistent, faster, and error-free deployments</strong></p><h3>🌳 Why Use CI/CD for React Native?</h3><p>Setting up CI/CD pipelines for React Native:</p><ul><li>Saves time by automating builds, tests, and deployments</li><li>Reduces human errors (no forgetting to bump versions!)</li><li>Ensures smooth team collaboration with <strong>automatic builds on every push or pull request</strong></li></ul><h3>✨ Branch Strategy for CI/CD</h3><p>For effective CI/CD, maintain <strong>two main branches</strong>:</p><ol><li><strong>test</strong> — for staging builds and testing new features</li><li><strong>main</strong> (or <strong>master</strong>) — for production-ready builds</li></ol><p>This ensures your production releases remain stable while you test features in isolation.</p><h3>🔧 Step 1. Automate Version Management for React Native Apps</h3><p>Manually updating version numbers is error-prone. Automate it by creating a script to bump:</p><ul><li><strong>Android</strong> versionCode and versionName</li><li><strong>iOS</strong> build number</li></ul><p>In your project, create:</p><pre>// scripts/bump-version.js<br><br>const fs = require(&#39;fs&#39;);<br>const { execSync } = require(&#39;child_process&#39;);<br><br>/**<br> * ✅ Bump Android versionCode and versionName<br> */<br>function bumpAndroidVersion() {<br>  const gradleFile = &#39;./android/app/build.gradle&#39;;<br>  let buildGradle = fs.readFileSync(gradleFile, &#39;utf8&#39;);<br><br>  // Bump versionCode<br>  buildGradle = buildGradle.replace(/versionCode (\d+)/, (match, p1) =&gt; {<br>    const newVersionCode = parseInt(p1) + 1;<br>    console.log(`✅ Bumped Android versionCode: ${p1} -&gt; ${newVersionCode}`);<br>    return `versionCode ${newVersionCode}`;<br>  });<br><br>  // Bump patch versionName (e.g. 1.0.0 -&gt; 1.0.1)<br>  buildGradle = buildGradle.replace(/versionName &quot;(\d+\.\d+\.\d+)&quot;/, (match, p1) =&gt; {<br>    const parts = p1.split(&#39;.&#39;);<br>    parts[2] = parseInt(parts[2]) + 1;<br>    const newVersionName = parts.join(&#39;.&#39;);<br>    console.log(`✅ Bumped Android versionName: ${p1} -&gt; ${newVersionName}`);<br>    return `versionName &quot;${newVersionName}&quot;`;<br>  });<br><br>  fs.writeFileSync(gradleFile, buildGradle);<br>}<br><br>/**<br> * 🍏 Bump iOS build number using agvtool<br> */<br>function bumpiOSVersion() {<br>  try {<br>    console.log(&quot;✅ Bumping iOS build number...&quot;);<br>    execSync(&#39;cd ios &amp;&amp; xcrun agvtool next-version -all&#39;, { stdio: &#39;inherit&#39; });<br><br>    // Optional: bump marketing version<br>    // execSync(&#39;cd ios &amp;&amp; xcrun agvtool bump-marketing-version 1.0.1&#39;, { stdio: &#39;inherit&#39; });<br>  } catch (error) {<br>    console.error(&quot;❌ Failed to bump iOS version:&quot;, error);<br>    process.exit(1);<br>  }<br>}<br><br>// Run both bump functions<br>bumpAndroidVersion();<br>bumpiOSVersion();</pre><h3>⚙️ Step 2. Set Up GitHub Actions Workflow for React Native</h3><h3>🌳 Workflow Structure</h3><p>For clarity and safety, use <strong>two separate YAML workflow files</strong>:</p><pre>.github/<br>  workflows/<br>    test.yml  # For all testing builds (Android APK + iOS TestFlight)<br>    prod.yml  # For all production builds (Android AAB + iOS App Store)✅ This ensures you:<br></pre><p>✅ This ensures you:</p><ul><li><strong>Avoid accidental production deploys</strong></li><li>Run <strong>both Android and iOS builds in one workflow per purpose</strong></li><li>Have <strong>clean manual triggers</strong> for each environment</li></ul><pre># Workflow Name: Test Builds<br># This workflow builds Android APK for testing and iOS TestFlight builds for testing.<br># Change branch name below as per your own use case.<br><br>on:<br>  push:<br>    branches: [ test ]    # Replace &#39;test&#39; with your testing branch if needed<br>  workflow_dispatch:<br><br>jobs:<br>  build-android:<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      - uses: actions/checkout@v3<br>        # ✅ Checkout your code from GitHub<br><br>      - uses: actions/setup-node@v3<br>        with:<br>          node-version: &#39;18&#39;<br>        # ✅ Setup Node.js environment (version 18)<br><br>      - run: npm install<br>        # ✅ Install project dependencies<br><br>      - uses: actions/setup-java@v3<br>        with:<br>          distribution: &#39;zulu&#39;<br>          java-version: &#39;17&#39;<br>        # ✅ Setup Java environment for Gradle build<br><br>      - name: Cache Gradle wrapper &amp; dependencies<br>        uses: actions/cache@v3<br>        with:<br>          path: |<br>            ~/.gradle/wrapper<br>            ~/.gradle/caches<br>          key: ${{ runner.os }}-gradle-${{ hashFiles(&#39;**/gradle-wrapper.properties&#39;) }}<br>          restore-keys: |<br>            ${{ runner.os }}-gradle-<br>        # ✅ Cache Gradle to speed up future builds<br><br>      - name: Make Gradle wrapper executable<br>        run: chmod +x ./android/gradlew<br>        # ✅ Ensure Gradle wrapper has executable permissions<br><br>      - name: Clean Android build<br>        run: |<br>          cd android<br>          ./gradlew clean<br>        # ✅ Clean previous Android build outputs<br><br>      - name: Build Android APK (release)<br>        run: |<br>          cd android<br>          ./gradlew assembleRelease<br>        # ✅ Build Android APK (release) for testing builds<br><br>      # - name: Build Android Production Bundle (AAB)<br>      #   run: |<br>      #     cd android<br>      #     ./gradlew bundleRelease<br>      #   # 🔒 Uncomment above if you also want test AAB build alongside APK<br><br>      - name: Upload Android APK artifact<br>        uses: actions/upload-artifact@v4<br>        with:<br>          name: app-release.apk<br>          path: android/app/build/outputs/apk/release/app-release.apk<br>          retention-days: 7<br>        # ✅ Uploads the generated APK as an artifact to GitHub for download or test distribution<br><br>      # ✅ ✅ COMMIT NOTE:<br>      # This job builds Android APK for testing.<br>      # Replace &#39;test&#39; with your testing branch if different.<br><br>  build-ios:<br>    runs-on: macos-latest<br><br>    steps:<br>      - uses: actions/checkout@v3<br>        # ✅ Checkout your code from GitHub<br><br>      - uses: actions/setup-node@v3<br>        with:<br>          node-version: &#39;18&#39;<br>        # ✅ Setup Node.js environment (version 18)<br><br>      - name: Install dependencies<br>        run: npm install<br>        # ✅ Install project dependencies<br><br>      - name: List available Xcode versions<br>        run: ls /Applications | grep Xcode<br>        # ✅ List available Xcode versions for visibility<br><br>      - name: Select Xcode version<br>        run: sudo xcode-select -s /Applications/Xcode_15.2.app<br>        # ✅ Select required Xcode version for build<br><br>      - name: Install CocoaPods<br>        run: |<br>          cd ios<br>          pod install<br>        # ✅ Install iOS dependencies via CocoaPods<br><br>      - name: Install Fastlane<br>        run: sudo gem install fastlane<br>        # ✅ Install Fastlane for TestFlight or App Store deployment<br><br>      - name: Build &amp; Upload iOS Test build to TestFlight<br>        run: |<br>          cd ios<br>          fastlane release<br>        env:<br>          APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}<br>          APP_STORE_CONNECT_API_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_ISSUER_ID }}<br>          APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }}<br>          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}<br>        # ✅ Builds iOS test app and uploads to TestFlight via Fastlane<br>        # 🔒 Ensure all secrets are configured in GitHub Actions Secrets<br><br>      # ✅ ✅ COMMIT NOTE:<br>      # This job builds iOS test app and uploads to TestFlight.<br>      # Replace &#39;test&#39; with your testing branch if different.</pre><h3>🏭 Step 3. Set Up Your Production Workflow (Optional but Recommended)</h3><p>For production releases, create:</p><pre>prod.yml</pre><p>This workflow should:</p><ul><li>Bump version numbers</li><li>Build <strong>Android AAB</strong></li><li>Build <strong>iOS App Store release</strong></li><li>Upload to Play Console &amp; App Store</li></ul><h3>🎉 Final Thoughts</h3><p>You now have a fully automated <strong>CI/CD pipeline for React Native</strong> using GitHub Actions.</p><p>With this setup you get:</p><p>🔥 Faster builds<br> 💻 Zero load on your local machine<br> 🧪 Automatic testing builds<br> 🚀 One-click staging/production deployments<br> 🔢 Automatic version bumping</p><p>This instantly improves development speed, consistency, and team collaboration.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e660d0112520" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redux Thunk: Real Examples for Better Understanding]]></title>
            <link>https://medium.com/@usamaijaz912/redux-thunk-real-examples-for-better-understanding-ed66ab732ac6?source=rss-c6b96631220e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed66ab732ac6</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[redux-thunk]]></category>
            <dc:creator><![CDATA[Usamaijaz]]></dc:creator>
            <pubDate>Sun, 20 Aug 2023 09:15:54 GMT</pubDate>
            <atom:updated>2023-08-20T09:18:56.485Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t2p9NuGl-TPsfVhUJyq2gA.png" /></figure><p>hello Developers, today we discuss the most useable Redux middleware, Redux<strong> Thunk </strong>way to manage asynchronous operations and side effects within your Redux-based applications.</p><p><strong>Asynchronous actions: </strong>Redux Thunk dispatches things with Asynchronous actions, which is crucial when you fetch data from an API, perform network requests, or handle other asynchronous tasks while updating the state.</p><p>First, make sure you have Redux and Redux Thunk installed in your project:</p><pre>npm install redux react-redux redux-thunk</pre><p>now let&#39;s move it first and create a file &quot;store.js&quot;,</p><pre>// store.js<br>import { createStore, applyMiddleware } from &#39;redux&#39;;<br>import thunk from &#39;redux-thunk&#39;;<br>import rootReducer from &#39;./reducers&#39;; // Assuming you have your rootReducer<br><br>const store = createStore(rootReducer, applyMiddleware(thunk));<br><br>export default store;<br></pre><ol><li><strong>Integrate Redux Store with React:</strong></li></ol><p>In your main application file (often index.js or App.js), wrap your application with the Provider component from react-redux and provide your Redux store with it.</p><pre>// index.js<br>import React from &#39;react&#39;;<br>import ReactDOM from &#39;react-dom&#39;;<br>import { Provider } from &#39;react-redux&#39;;<br>import store from &#39;./store&#39;; // Import your Redux store<br>import App from &#39;./App&#39;; // Your root application component<br><br>ReactDOM.render(<br>  &lt;Provider store={store}&gt;<br>    &lt;App /&gt;<br>  &lt;/Provider&gt;,<br>  document.getElementById(&#39;root&#39;)<br>);</pre><p><strong>2</strong>: let’s create a new file in the src folder named “actions.js”</p><pre>// actions.js<br>import axios from &#39;axios&#39;;<br><br>// Action Types<br>export const FETCH_DATA_REQUEST = &#39;FETCH_DATA_REQUEST&#39;;<br>export const FETCH_DATA_SUCCESS = &#39;FETCH_DATA_SUCCESS&#39;;<br>export const FETCH_DATA_FAILURE = &#39;FETCH_DATA_FAILURE&#39;;<br><br>// Action Creators<br>const fetchDataRequest = () =&gt; {<br>  return {<br>    type: FETCH_DATA_REQUEST,<br>  };<br>};<br><br>const fetchDataSuccess = (data) =&gt; {<br>  return {<br>    type: FETCH_DATA_SUCCESS,<br>    payload: data,<br>  };<br>};<br><br>const fetchDataFailure = (error) =&gt; {<br>  return {<br>    type: FETCH_DATA_FAILURE,<br>    payload: error,<br>  };<br>};<br><br>// Thunk Action Creator<br>export const fetchData = () =&gt; {<br>  return (dispatch) =&gt; {<br>    dispatch(fetchDataRequest());<br>    axios.get(&#39;https://api.example.com/data&#39;)<br>      .then(response =&gt; {<br>        const data = response.data;<br>        dispatch(fetchDataSuccess(data));<br>      })<br>      .catch(error =&gt; {<br>        dispatch(fetchDataFailure(error.message));<br>      });<br>  };<br>};</pre><p><strong>3</strong>: So in the above code, we see three actions types (FETCH_DATA_REQUEST, FETCH_DATA_SUCCESS, and FETCH_DATA_FAILURE)</p><p>this is used to get data from APIs and dispatch this, so let&#39;s create a reducer file named “reducer.js”</p><pre>// reducer.js<br>import {<br>  FETCH_DATA_REQUEST,<br>  FETCH_DATA_SUCCESS,<br>  FETCH_DATA_FAILURE,<br>} from &#39;./actions&#39;;<br><br>const initialState = {<br>  data: [],<br>  isLoading: false,<br>  error: null,<br>};<br><br>const reducer = (state = initialState, action) =&gt; {<br>  switch (action.type) {<br>    case FETCH_DATA_REQUEST:<br>      return {<br>        ...state,<br>        isLoading: true,<br>        error: null,<br>      };<br>    case FETCH_DATA_SUCCESS:<br>      return {<br>        ...state,<br>        isLoading: false,<br>        data: action.payload,<br>      };<br>    case FETCH_DATA_FAILURE:<br>      return {<br>        ...state,<br>        isLoading: false,<br>        error: action.payload,<br>      };<br>    default:<br>      return state;<br>  }<br>};<br><br>export default reducer;</pre><p><strong>4</strong>:To use this in a React component, you would typically connect the component to Redux and dispatch the fetchData action when needed:</p><pre>// YourComponent.js<br>import React, { useEffect } from &#39;react&#39;;<br>import { useSelector, useDispatch } from &#39;react-redux&#39;;<br>import { fetchData } from &#39;./actions&#39;;<br><br>const YourComponent = () =&gt; {<br>  const dispatch = useDispatch();<br>  const data = useSelector(state =&gt; state.data);<br>  const isLoading = useSelector(state =&gt; state.isLoading);<br>  const error = useSelector(state =&gt; state.error);<br><br>  useEffect(() =&gt; {<br>    dispatch(fetchData());<br>  }, [dispatch]);<br><br>  if (isLoading) {<br>    return &lt;p&gt;Loading...&lt;/p&gt;;<br>  }<br><br>  if (error) {<br>    return &lt;p&gt;Error: {error}&lt;/p&gt;;<br>  }<br><br>  return (<br>    &lt;div&gt;<br>      {/* Render your data here */}<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default YourComponent;</pre><p>Congratulations! You have now successfully set up Redux Thunk in your Redux store. This enables you to manage asynchronous actions seamlessly within your Redux-powered application. Happy coding! 🚀”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed66ab732ac6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Dynamic Video/Audio Player with React Player in Next.js]]></title>
            <link>https://medium.com/@usamaijaz912/building-a-dynamic-video-audio-player-with-react-player-in-next-js-d5fa6c5e89ab?source=rss-c6b96631220e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5fa6c5e89ab</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[react-player]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Usamaijaz]]></dc:creator>
            <pubDate>Sat, 15 Jul 2023 17:45:22 GMT</pubDate>
            <atom:updated>2023-07-15T17:45:22.184Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, we will explore how to create a dynamic video/audio player using the popular React Player library in Next.js. This player allows us to play a variety of video/audio sources, such as YouTube, Dailymotion, AWS Cloud, and more.</p><p>To begin, let’s create a new Next.js app by running the following command:</p><pre>npx create-next-app@latest<br># or<br>yarn create next-app@latest</pre><p>After successfully installing Next.js, we need to add the React Player library to our project. You can do this by executing the following command:</p><pre>npm i react-player<br># or<br>yarn add react-player</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HUpIRJEcOdBKjgP8Dp5g3w.png" /></figure><p>With the React Player library installed, we can now proceed to implement our dynamic player. In the example below, we render a media player using the ReactPlayer component, which plays a video from AWS Cloud. We specify the video URL using the url parameter and activate the player&#39;s default controls with the controls prop. Additionally, we set the width and height to match the desired player size.</p><p>To run your Next.js app, use the following command:</p><pre>npm run dev</pre><p>This will start the development server, and you can view your app in the browser at <a href="http://localhost:3000.">http://localhost:3000.</a></p><p>By following these steps, you will have a new Next.js app set up with the React Player library installed, allowing you to create a dynamic video/audio player capable of playing content from various sources.</p><p>In the provided code snippet, you can see an example implementation of the React Player component within a Next.js functional component. The ReactPlayer component accepts the url prop to specify the video URL. To hide the native player controls, we set the controls prop to false.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*AlaAWw2BveQgQzjM-8M4Tw.png" /></figure><p>You may use the controls prop to show or conceal the native player controls for videos played with React Player. This property accepts a <strong>boolean</strong> value, with true turning on native player controls and false turning them off.</p><pre>&quot;use client&quot;<br>import Image from &#39;next/image&#39;<br>import ReactPlayer from &#39;react-player&#39;<br><br><br>export default function Home() {<br><br>  return (<br>    &lt;main className=&quot;flex min-h-screen flex-col items-center justify-between p-24&quot;&gt;<br>      &lt;ReactPlayer <br>       url=&#39;https://giistyxelor.s3.amazonaws.com/giists/video/video0cP3w019TiZYYcUy22WY.mp4&#39;<br>       controls={false} /&gt;<br>    &lt;/main&gt;<br>  )<br>}</pre><p>To further enhance the player’s functionality, you can utilize dynamic props. For example, by setting the playing prop to true, the video will automatically start playing when the player is rendered.</p><pre>   &lt;ReactPlayer <br>       url=&#39;https://giistyxelor.s3.amazonaws.com/giists/video/video0cP3w019TiZYYcUy22WY.mp4&#39;<br>       controls={false} <br>       playing={true}<br>       /&gt;</pre><p>For more detailed instructions and additional variables to control various features of React Player, please refer to the <a href="https://github.com/CookPete/react-player">React Player Documentation</a>. This documentation serves as a comprehensive resource to help you leverage the full potential of React Player in your projects.</p><p>Enjoy building your dynamic video/audio player with React Player in Next.js!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5fa6c5e89ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>