<?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 Chandrachudh K on Medium]]></title>
        <description><![CDATA[Stories by Chandrachudh K on Medium]]></description>
        <link>https://medium.com/@Chandrachudh?source=rss-e8aa989cf106------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_GUUBJHqIm2-wqgdHxmdaw.jpeg</url>
            <title>Stories by Chandrachudh K on Medium</title>
            <link>https://medium.com/@Chandrachudh?source=rss-e8aa989cf106------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 10:42:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Chandrachudh/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[From Home to Stockholm: My Experiences and Lessons from Migrating to Sweden]]></title>
            <link>https://medium.com/nsjokers/from-home-to-stockholm-my-experiences-and-lessons-from-migrating-to-sweden-8a5b16911bb1?source=rss-e8aa989cf106------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a5b16911bb1</guid>
            <category><![CDATA[stockholm]]></category>
            <category><![CDATA[moving-abroad]]></category>
            <category><![CDATA[sweden]]></category>
            <category><![CDATA[settlinginsweden]]></category>
            <category><![CDATA[migration]]></category>
            <dc:creator><![CDATA[Chandrachudh K]]></dc:creator>
            <pubDate>Tue, 04 Jul 2023 17:32:30 GMT</pubDate>
            <atom:updated>2023-07-04T17:32:30.118Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wem_qymvNKXxeJBML2hQ1A.jpeg" /></figure><h3>Part 1: The Perseverance of a Dream</h3><blockquote>It all began with a single goal: to make Stockholm my new home. However, I quickly realized that the key to achieving this dream lay in securing a job in the Swedish capital. With limited funds and a burning desire to make my migration a reality without draining my savings, I embarked on a relentless quest.</blockquote><blockquote>For seven months, I tirelessly scoured professional platforms like <strong>LinkedIn</strong>, navigating through countless applications and attending numerous interviews. But amidst the rollercoaster ride of hope and disappointment, I confronted a difficult decision: should I risk quitting my current job to focus solely on this pursuit? The financial strain weighed heavily on my mind, urging caution when it came to advising others.</blockquote><blockquote>Yet, from the depths of my own experience, I discovered a valuable lesson that would shape my journey forever…</blockquote><p>Embarking on my migration journey to Stockholm, finding a job became the crucial first step in realizing my dreams without depleting my savings. For seven long months, I tirelessly scoured platforms like LinkedIn, submitting countless applications and attending interviews. It was a challenging period, as I had taken the bold step of quitting my job to focus on this pursuit. Financial strain tested my resolve, making me hesitant to advise others to follow suit.</p><p>However, I learned a valuable lesson: once an offer arrives, swift action is vital. Initiating the notice period promptly and commencing the visa application process without delay can help secure a smoother transition, avoiding the prolonged financial hardships I faced. By sharing this experience, I hope to guide fellow migrants toward a more stable and successful path in their own endeavors.</p><p>Let us start with the time I started the interview process. As an iOS applications developer, the interview process consisted of IQ tests, coding tests, and several rounds of interviews related to my tech stack and my 10 years of experience in the industry. The interview process started at the end of December 2022, and I was offered a new opportunity to work with them in the first week of February 2023.</p><p>With the elation of securing a job offer, I eagerly signed the <strong>employment contract</strong>, understanding that this was the first step towards my new life in Stockholm. Little did I know that the journey ahead would require additional support. My new employer introduced me to a reputable visa processing agency, a third-party partner entrusted with navigating the intricate procedures involved in obtaining a visa. (Note: Specific names of the employer and third-party agency have been omitted for privacy reasons.)</p><p>The first thing they asked me to do was to fill out and sign a power of attorney form so that they could handle the application on my (and my wife’s) behalf. We also provided several pieces of information about us to the agency, such as <strong>passport data and marriage certificates</strong>. We were provided with two <strong>control numbers</strong> for me and my wife, which would help us keep track of the process on their website. You can check the status of your application using your control number <a href="https://www.migrationsverket.se/English/Contact-us/Check-your-application-without-logging-in.html">here</a>.</p><p>After waiting for about a month, I was informed by the agency that the Swedish Migration Agency had approved our application! The next process was to get the<strong> work permit card</strong> from the <strong>Embassy of Sweden</strong>. In order to obtain this, we needed to submit our <strong>biometric</strong>s to the Embassy. I swiftly booked flight tickets to New Delhi, where the Embassy of Sweden was located. You can find the details of the Embassy of Sweden in New Delhi <a href="https://www.swedenabroad.se/en/embassies/india-new-delhi/contact/">here</a>. The allotted time for submitting your biometrics is between <strong>8:30 am &amp; 10:30 am</strong> IST.</p><p>A few tips for your visit to the Embassy of Sweden:</p><ul><li>Be there at least <strong>30 minutes before</strong> the designated time to account for any queues.</li><li>Register your name at the security office upon arrival.</li><li><strong>Avoid carrying any luggage</strong>, as it is not permitted inside the Embassy compound.</li><li>Your <strong>cell phones, wallets</strong>, etc., are not allowed inside. The Embassy provides <strong>locker facilities</strong> to hold these.</li><li>Bring your <strong>original passport</strong> and <strong>control number</strong> on a small piece of paper.</li></ul><p>Once inside, you will need to get a token and wait for your turn. The whole process took about 10 minutes for me and my wife. Afterward, we returned home and patiently waited for someone to reach out to us about the arrival of the permit cards.</p><p>Two weeks later, I received an email instructing me to collect the permit cards from the Embassy. The process for collecting the cards was between <strong>11:00 am and 12:00 pm</strong> IST, and it was a swift affair, taking about 15 minutes.</p><p>As soon as I obtained my permit card, I informed my new employer, and they promptly booked my tickets to Stockholm. The next week, I found myself standing at the airport, clutching my boarding pass tightly. It was a moment of reflection on the incredible journey that led me here.</p><blockquote>Part 1 of my migration tale had been a rollercoaster of perseverance and uncertainty, but it was just the beginning. Little did I know that the real adventure awaited me on Swedish soil. With a newfound job, a promising future, and dreams that seemed within reach, I stepped onto the plane with a mixture of excitement and apprehension.</blockquote><blockquote>The next chapter of my story, “<strong>Unlocking the Essentials</strong>,” would take you on a journey through the practicalities of settling in Sweden. From registering for a personal number to navigating the intricacies of the banking system and embarking on the quest for a place to call home, Part 2 reveals the essential steps that awaited me in building a life in this beautiful country.</blockquote><blockquote>Join me as we unlock the doors to a new chapter, where dreams become reality and Swedish adventures await. Stay tuned for “Unlocking the Essentials” in the next installment of my Sweden migration blog.</blockquote><h4>Author’s Note:</h4><p><em>I would like to express my gratitude to ChatGPT for its invaluable assistance in generating content and providing insights for this blog. ChatGPT is an AI language model developed by OpenAI, and it has played a significant role in helping me shape my thoughts and ideas throughout the writing process. I am thankful for the capabilities of this remarkable AI tool and the contributions it has made to this blog.</em></p><h4>Information Note: Based on Personal Experience</h4><p><em>Dear Readers,</em></p><p><em>I would like to emphasize that the information shared in this blog, including the insights and experiences described, is based solely on my personal journey of migrating to Sweden. While I have made every effort to provide accurate and up-to-date information, please note that individual experiences may vary.</em></p><p><em>Migration processes and requirements can be subject to change, and it is essential to consult official government sources, relevant institutions, and legal professionals for the most current and accurate information regarding migration to Sweden. I encourage you to conduct thorough research and seek professional advice to ensure compliance with all applicable laws and regulations.</em></p><p><em>The purpose of this blog is to share my personal perspective and provide insights into my own experiences throughout the migration process. It is not intended as professional advice or a comprehensive guide.</em></p><p><em>Thank you for joining me on this journey, and I hope that the information I share can be helpful and inspiring as you embark on your own migration adventure.</em></p><p><em>Best regards,</em></p><p><em>Chandrachudh K</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a5b16911bb1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nsjokers/from-home-to-stockholm-my-experiences-and-lessons-from-migrating-to-sweden-8a5b16911bb1">From Home to Stockholm: My Experiences and Lessons from Migrating to Sweden</a> was originally published in <a href="https://medium.com/nsjokers">NSJoker’s</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swift Lint & Apple Silicon Computers]]></title>
            <link>https://medium.com/@Chandrachudh/swift-lint-apple-silicon-computers-f5b81a7f8925?source=rss-e8aa989cf106------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5b81a7f8925</guid>
            <category><![CDATA[swiftlint]]></category>
            <category><![CDATA[m1-macbook-pro]]></category>
            <category><![CDATA[apple-silicon]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[xcode]]></category>
            <dc:creator><![CDATA[Chandrachudh K]]></dc:creator>
            <pubDate>Fri, 13 May 2022 16:16:50 GMT</pubDate>
            <atom:updated>2022-05-13T16:16:50.447Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Apple Silicon?</h3><blockquote>Starting with certain models introduced in the late 2020, Apple began the transition from Intel processors to Apple silicon in Mac computers.</blockquote><p>Check out the instructions here by Apple to check what Apple computer you are using: <a href="https://support.apple.com/en-in/HT211814">https://support.apple.com/en-in/HT211814</a></p><h3>What is Swift Lint?</h3><blockquote>A tool to enforce Swift style and conventions, loosely based on the now archived <a href="https://github.com/github/swift-style-guide">GitHub Swift Style Guide</a>. SwiftLint enforces the style guide rules that are generally accepted by the Swift community. These rules are well described in popular style guides like <a href="https://github.com/raywenderlich/swift-style-guide">Ray Wenderlich’s Swift Style Guide</a>.</blockquote><p>To know how to install SwiftLint in your Apple computer follow the instructions here: <a href="https://github.com/realm/SwiftLint">https://github.com/realm/SwiftLint</a></p><p>I recently transitioned from using an older Macbook to the new Macbook M1 Pro. The code I was working on has Swift Lint enabled in it at its glory! After completing the cloning, and installing the swift lint using the “Homebrew” the issue started popping up.</p><blockquote>warning: SwiftLint does not exist, download it from <a href="https://github.com/realm/SwiftLint">https://github.com/realm/SwiftLint</a></blockquote><p>This is the message we have added to the run script phase on our project. This script checks for the swift lint file program installed in our machine and tries to access it. If it was not found on the expected location it will throw the above warning. This is strange, I just installed swift lint just as it was explained in its setup guide.</p><h3>What is the reason?</h3><p>As it turns out, on the M1 Macs, the SwiftLint is installed in the /opt/homebrew/bin/, not in /usr/local/bin/ as it used to be. Because of this, the SwiftLint is not added to the PATH and is therefore not available for the Xcode.</p><h3>The Solution</h3><p>From the official documentation found in Swift Lint’s github page, we can find the solution for this problem.</p><p>add /opt/homebrew/bin to the PATH environment variable in your build phase</p><pre>export PATH=&quot;$PATH:/opt/homebrew/bin&quot;<br>if which swiftlint &gt; /dev/null; then<br>  swiftlint<br>else<br>  echo &quot;warning: SwiftLint not installed, download from <a href="https://github.com/realm/SwiftLint">https://github.com/realm/SwiftLint</a>&quot;<br>fi</pre><p>In the script above, we create an alias for the SwiftLint executable, located in the <em>homebrew</em> folder, and later use it to lint the code.</p><h3><strong>Thats all Folks!</strong></h3><p>References:</p><ul><li><a href="https://github.com/realm/SwiftLint">GitHub - realm/SwiftLint: A tool to enforce Swift style and conventions.</a></li><li><a href="https://thisdevbrain.com/how-to-fix-the-swiftlint-not-installed-warning-on-m1-macs/">How to fix the &quot;SwiftLint not installed&quot; warning on M1 Macs | This Dev Brain by Michal Tynior</a></li></ul><p><em>Author Notes</em></p><p>This article is an attempt to increase the sources available for solving some particular problem.</p><p>If you are interested in my writing style, and would want to read more articles, comment your interested topics on the response section.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5b81a7f8925" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Read-only properties in Swift]]></title>
            <link>https://levelup.gitconnected.com/read-only-properties-in-swift-c90faa6f999e?source=rss-e8aa989cf106------2</link>
            <guid isPermaLink="false">https://medium.com/p/c90faa6f999e</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[readonly]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Chandrachudh K]]></dc:creator>
            <pubDate>Sat, 18 Dec 2021 13:21:30 GMT</pubDate>
            <atom:updated>2022-02-22T09:00:28.678Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
            <content:encoded><![CDATA[<p>What is a read-only property? How do you create one in Swift programming language?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*G8wa3HRjxwkHU7VOQC1CuA.png" /></figure><blockquote><strong>Read-only means that we can access the value of a property but we can’t assign any value to it.</strong></blockquote><p>Often developers confuse <strong>Read-only </strong>with <strong>Constants</strong> when we ask them for the definition!</p><h3>What is expected of a Read-Only property?</h3><p>Let us imagine a class called Addition like the one below</p><pre><em>class Addition {<br>  var lhs: Int = 0<br>  var rhs: Int = 0<br>  var sum: Int = 0<br>}</em></pre><p>When you try to print the property “sum” from an instance of this class, the console should always print the sum of values of “lhs” and “rhs”. After printing sum once and then if we change the value of either “lhs” or “rhs” or both and print the value of “sum” again, it should print the updated sum of “lhs” and “rhs”.</p><p>Later if we try to assign a value to “sum” like</p><pre><em>var obj = Addition()<br>obj.lhs = 10<br>obj.rhs = 20<br>print(obj.sum)</em></pre><pre><em>obj.sum = 50 // compiler error here<br>print(obj.sum)</em></pre><p>This will result in a compiler error.</p><h3>Creating a read-only property</h3><p>Read-only properties are <strong>also known as <em>Computed Properties</em></strong> in Swift. Most of the programming languages including Swift has the concept of “Getters &amp; Setters”.</p><p>Any normal variable you create in Swift will by default has a getter &amp; setter created for it. since this happens internally we don&#39;t have to worry about it. Sometimes the developer would want to take matters to hand and define a custom getter &amp; setter for their variables.</p><pre><em>var myValue: Int {<br>  get {<br>    return 10<br>  }<br>  set {<br>    save(newValue)<br>  }<br>}</em></pre><blockquote><strong><em>In swift, we can create a read-only property by only defining a getter for a variable. Meaning no setter!</em></strong></blockquote><pre>v<em>ar sum: Int {<br>  get {<br>    return lhs + rhs<br>  }<br>} </em></pre><p>Since the variable only has a getter, the compiler will throw an error when we try to assign a value to “sum”.</p><p>With the new updates in Swift you can even reduce the number of lines you type like this:</p><pre><em>var sum: Int {<br>  lhs + rhs<br>}</em></pre><h3>Question time!</h3><p>Try and create a <strong>read-only property in Objective C</strong>. If you have an answer post a response!</p><h4>Bonus!</h4><h3>What is a constant?</h3><blockquote><strong>A constant is a value that should not be altered by the program during normal execution.</strong></blockquote><p>In swift, we can create a constant value by using the “<strong>let</strong>” keyword. For example:</p><pre><em>let aConstant = 10</em></pre><h3>About me</h3><blockquote><strong>Check:</strong><em> </em><a href="https://about.me/chandrachudhk"><em>https://about.me/chandrachudhk</em></a></blockquote><h4>Here’s a donut for you!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*_a1Lm-U7KsvmzPcm_H24kg.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c90faa6f999e" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/read-only-properties-in-swift-c90faa6f999e">Read-only properties in Swift</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streaming Videos With AWS Elastic Transcoder My Story!]]></title>
            <link>https://medium.com/f22labs/streaming-videos-with-aws-elastic-transcoder-my-story-a88411c8ef8?source=rss-e8aa989cf106------2</link>
            <guid isPermaLink="false">https://medium.com/p/a88411c8ef8</guid>
            <category><![CDATA[elastic-transcoder]]></category>
            <category><![CDATA[vod]]></category>
            <category><![CDATA[hls]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[drm]]></category>
            <dc:creator><![CDATA[Chandrachudh K]]></dc:creator>
            <pubDate>Mon, 27 Apr 2020 06:01:28 GMT</pubDate>
            <atom:updated>2020-04-27T06:01:28.090Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YDyidOH8HBUX2o_dMxedjg.jpeg" /><figcaption>\Photo by <a href="https://unsplash.com/photos/jvJZY0olJvE?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Parker Byrd</a> on <a href="https://unsplash.com/search/photos/streaming?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>This is my version of how to stream videos with AWS at minimal cost and decent security for the content. We at <a href="http://f22labs.com/">F22 Labs</a> recently finished a client project, which is an on-demand video service.</p><p>We wanted to ensure the following :</p><ul><li>That the content is not scrapable/downloadable by extracting the video URL.</li><li>Enable Dynamic bit rate play, so that the streaming bit rate would automatically toggle based on the internet connection strength.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*vNRd1VSYBdz_8zNP8JTwEA.gif" /></figure><p>Before we dive in, here’s some context. This is my first time directly playing with the AWS console. I have written several iOS components that use AWS APIs, but this is my first time setting up an entire AWS service from scratch for a project. Being a developer who has only worked in iOS and other frontend technologies, I really felt like a monkey who has got a diamond in his hand! I struggled hard, luckily my team and our client were encouraging — lucky me!</p><p>Here’s the basic version of how not to set up video streaming :</p><p>Store the videos in 2 S3 Buckets. One will store the original .mp4 videos and the other stores the output files which can be streamed. Bear with me here, I will explain what the output files are and how to generate them in a bit.</p><p>When you put a .mp4 video directly to S3 and use the S3 URL to stream the video, you will be disappointed. The trial iOS app I built to test this started downloading the entire video in one shot it took about a minute to download the 2 min video file and started playing it. This is not the expected behavior we wanted. But this was good to know! Then what is the solution for this?</p><p>This failed because :</p><ul><li>It did not stream, but instead downloaded the entire file in one shot.</li><li>Was not secure, as anyone that sniffs the traffic can get the .mp4 URLs and can download them.</li></ul><h4>Here comes the savior: HTTP Live Streaming — HLS</h4><p>This is an amazing protocol for VOD (Video On Demand).</p><p>Here’s what HLS does :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2bTwhprLRdZz1wTk4yBVig.png" /></figure><ul><li>It allows you to breakdown your video into smaller segments (of say 10 seconds). A segment is the smallest length of video that would be played without buffering.</li><li>Multiple copies of the segmented video are created with different bitrates to allow for download based on the internet speed of the consumer.</li><li>A playlist is a compilation of the different smaller segments. There is one playlist per bitrate. Example: We will have 1 playlist for 1080p, 1 for 360p and so on. These playlists are .m3u8 files.</li><li>Then there is another grand .m3u8 (playlist) file, that contains all the other .m3u8 files. This is how the player toggles between different bitrate video segments based on internet strength.</li></ul><h3><strong>How to Create HLS Videos in AWS</strong></h3><p>AWS has the following services that will help us do it :</p><ul><li>AWS Media Convert</li><li>AWS Elastic Transcoder</li></ul><h4>AWS Media Convert:</h4><p>Using AWS Media Convert, you can create multiple playlists with different bit rates. But you need to write additional code to create the containing .m3u8 file that references the individual bitrate .m3u8 files.</p><p>And this allows to stream the video at dynamic bitrates depending on the strength of the internet connection, but it’s not secure. On video play, if we sniff the requests to get the video URL, using the URL, the video can be downloaded.</p><p>There is a way, however, to enable Digital Rights Management (DRM) while making the output files from the Media Convert. AWS provides us with the option to enable this feature but requires 3rd party services to encrypt the videos. We were looking for a way to achieve our requirements completely through AWS, and that’s when we tried our next service.</p><h4>Elastic Transcoder:</h4><p>Here’s how we achieved both our requirements with Elastic Transcoder :</p><p><strong>Step 1</strong>: Login to AWS console and from the services menu select S3.</p><p><strong>Step 2</strong>: In S3 create 3 buckets with the preferred region. 1) <strong>Input bucket</strong>, 2) <strong>Output bucket</strong> &amp; 3) <strong>Image thumbnail bucket</strong>.</p><p><strong>Step 3</strong>: Upload the video you need to convert into Input bucket.</p><p><strong>Step 4</strong>: From the services menu select Elastic Transcoder.</p><p><strong>Step 5</strong>: Click on <strong>Create New Pipeline</strong> button. You only need to do this one time.</p><p><strong>Step 6</strong>: Fill the form!</p><p><em>Pipeline name</em>: This must be unique to your account</p><p><em>Input Bucket</em>: Select the Input bucket you created before</p><p><em>IAM Role</em>: Select the Elastic_Transcoder_Default_Role. This is the default role AWS created for you while you created your account in AWS. If you prefer to use other IAM roles feel free to select them</p><p><strong><em>Configuration for Amazon S3 Bucket for Transcoded Files and Playlists</em></strong><em> — </em><strong><em>Section</em></strong></p><p><em>Bucket</em>: This is the Output bucket where the converted videos will be stored. Select your Output bucket.</p><p>Storage Class: Select the value “Standard” from the dropdown</p><p><strong><em>Configuration for Amazon S3 Bucket for Thumbnails — Section</em></strong></p><p><em>Bucket</em>: This is where the Thumbnail images generated by the Elastic Transcoder is stored. Select the Image thumbnail bucket you created earlier.</p><p><em>Storage Class</em>: Select the value “Standard” from the dropdown</p><p>In the <strong><em>Notifications section</em></strong>, I prefer to set everything to “No Notifications”</p><p><strong><em>Encryption — Section</em></strong></p><p><em>AWS KMS Key ARN</em>: Select the custom radio button. Doing this will create a new text box.</p><p><em>ARN Key</em>: Here you will have to enter your ARN Key. I will explain how to create your ARN key in the next section.</p><p><strong>Step 7</strong>: Click the “Create Pipeline” button. You will have wait until the new pipeline you created to change its status to Active.</p><p><strong>Step 8</strong>: Once The pipeline is active, click on the “<strong>Create New Job</strong>” button. To create a new job. For every video, you have to convert you will have to create a new job.</p><p><strong>Step 9</strong>: Fill the new form!</p><p><em>Pipeline</em>: Select your pipeline from the dropdown.</p><p><em>Output Key Prefix</em>: Here you will have to select the path where the output video should be saved in the Output bucket of your pipeline. AWS will automatically show you some suggestions as you type.</p><p><strong><em>Input Details</em></strong></p><p><em>Input Key: </em>Here select the video file you want to convert. AWS will automatically list all the contents of the Input bucket for you.</p><p><em>Decryption Parameters</em>: Select the None radio button</p><p><em>Available Settings</em>: Do not select any options here</p><p><strong><em>Output Details</em></strong></p><p>We will have to create multiple outputs based on the output requirements of our application. For our case, we will need 2M, 1.5M and 1M presets that are already there. So we will be creating 3 outputs using the “Add Another Output” option at the bottom of this section in AWS.</p><p><em>Preset</em>: From the dropdown select the preset that you need for first output select “System Preset: HLS 2M” for second output select “System Preset: HLS 1.5M” and for third output select “System Preset: 1M”.</p><p><em>Segment Duration</em>: This is the duration of each “.ts” segment file that will be created. I set this value to 10 meaning 10 seconds.</p><p><em>Output Key</em>: Enter name for the output file, this will be prefix added to each .ts file and the playlist the ts files are part of. Make sure this is unique for every output in this job.</p><p>Do not change any other values in this section</p><p><strong><em>Playlists</em></strong></p><p>In this section click on the “Add Playlist” button. The view will change to show some more contents now. Fill these contents as follows:</p><p><em>Master playlist Name</em>: The name of the playlist. Make this unique, trust me you will not regret this!</p><p><em>Playlist Format</em>: From the dropdown select the format “HLSv3”</p><p><em>Outputs in Master Playlist</em>: from the dropdown select an output you created before. After this click on the “+” button next to the dropdown, this will create a new dropdown with the same title, from this select the next output. Likewise, repeat the process to select all the 3 outputs we have created.</p><p><em>Content protection</em>: Select the HLS AES, then from the new dropdown pick “With Variant Playlists”. Make sure that the checkbox for “Autogenerate encryption key” is selected.</p><p><strong>Step 10</strong>: Last step click on the “Create New Job” button. Wait for some time for the job to complete. Once it is completed, got to the Output s3 bucket, and find the location where you have saved the converted video file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cyGZopIyZPzlsOuIUvQhQQ.gif" /></figure><p>From the multiple files that are here select the file with the name that you provided as the “<strong>Master Playlist Name</strong>”.playlist. Fetch the URL corresponding to this .playlist file. Make the necessary changes to convert this content to be distributed from CloudFront. That&#39;s it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1kAAGFtON40jnkOyaOKSFg.png" /><figcaption>This is what AWS Elastic Transcoder does!</figcaption></figure><p>This time all the .ts files are secured, even if someone manages to download the .ts files, the files will not play! But…</p><h4>This is Not Enough…</h4><p>If any person who has the URL for the .playlist file can download the video from any video download manager 😅</p><p>Our solution for this problem is to use URL signing offered by CloudFront. Once you enable this the video you are streaming will be secured.</p><h3>About Me</h3><blockquote><strong><em>Check:</em></strong> <a href="https://about.me/chandrachudhk">https://about.me/chandrachudhk</a></blockquote><h4>Thank you for reading! Here’s a donut for you!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*_a1Lm-U7KsvmzPcm_H24kg.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a88411c8ef8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/f22labs/streaming-videos-with-aws-elastic-transcoder-my-story-a88411c8ef8">Streaming Videos With AWS Elastic Transcoder My Story!</a> was originally published in <a href="https://medium.com/f22labs">F22 Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS IoT and React Native, I love you, but you can do better.]]></title>
            <link>https://medium.com/f22labs/aws-iot-and-react-native-i-love-you-but-you-can-do-better-55799df7b4b6?source=rss-e8aa989cf106------2</link>
            <guid isPermaLink="false">https://medium.com/p/55799df7b4b6</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[aws-iot]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[mqtt]]></category>
            <dc:creator><![CDATA[Chandrachudh K]]></dc:creator>
            <pubDate>Tue, 18 Sep 2018 13:11:39 GMT</pubDate>
            <atom:updated>2018-09-18T13:16:48.148Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qUoyEaZgru5tk2Fibybkrw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/anapPhJFRhM?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Bence ▲ Boros</a> on <a href="https://unsplash.com/search/photos/iot?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>I recently started working with React Native and AWS IoT for a new project. Being a hardcore iOS developer, this change was a little hard to take on. Luckily I had a team of solid React Native developers to guide me.</p><p>My part of the project was not building the UI/UX or API integration, but baking real time communication using <a href="http://mqtt.org/"><strong>MQTT</strong></a>! for the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*iZro1zde22AxDI2qjWu47Q.gif" /></figure><p>The concept of <strong>MQTT</strong> may seem familiar to you if you’ve already worked with <a href="https://firebase.google.com/docs/"><strong>Firebase Cloud Messaging</strong></a><strong>.</strong></p><p>If not, no worries … this post isn’t going to help you much either … just kidding :)</p><h3>How MQTT Works? ⚙️</h3><blockquote><em>Publisher: </em>There are one or more publisher.</blockquote><blockquote><em>Subscriber: </em>There are one or more subscribers.</blockquote><p>A publisher can create and publish to multiple Channels (also called <em>Topics</em>).</p><p>A Subscriber can listen to multiple channels and fetch the real time published message. The message that is published is not stored anywhere unless you design your own MQTT broker.</p><p>Consider the MQTT broker as a box. Publisher pushes message into the box. Subscriber can connect to the box with the corresponding Channel name(Topic) and receive the message.</p><p>The most common convention to name a channel is using the pattern : “Topic/Subtopic”.</p><h3>GETTING STARTED ON AWS IoT 👍</h3><p><strong>Step 1</strong>: You need an AWS account.</p><p><strong>Step 2</strong>: Create a Cognito pool. This is for authentication purpose. If you don’t know how to create a Cognito pool check <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/tutorial-create-identity-pool.html">here</a>.</p><p><strong>Step 3</strong>: When you are in your AWS home page search for “IoT Core” and visit the AWS IOT dashboard. If I were you I’d bookmark this page :)</p><p><strong>Step 4</strong>: To setup MQTT you will need the following :</p><blockquote>1.The AWS Cognito pool Id</blockquote><blockquote>2. A Policy</blockquote><blockquote>3. Your AWS IoT Specific IoT endpoint url.</blockquote><p>You already have a Cognito pool id from where you created the Cognito pool. If not create one. This one is Generic and can be used for all kinds of AWS Authentication (I believe … but hey, I’m no AWS wizard).</p><p>The detailed instructions for creating a policy can be found <a href="https://docs.aws.amazon.com/iot/latest/developerguide/create-iot-policy.html">here</a>. AWS IoT policies are JSON documents. They follow the same conventions as IAM policies. AWS IoT supports named policies so many identities can reference the same policy document. Named policies are versioned so they can be easily rolled back. To know more click check <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-policies.html">here</a>. After creating the policy, click on it, inside your policy’s overview tap on the “Edit policy document” button. and replace the JSON with:</p><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: &quot;iot:Connect&quot;,<br>      &quot;Resource&quot;: &quot;*&quot;<br>    },<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: [<br>        &quot;iot:Publish&quot;,<br>        &quot;iot:Subscribe&quot;,<br>        &quot;iot:Receive&quot;<br>      ],<br>      &quot;Resource&quot;: &quot;*&quot;<br>    }<br>  ]<br>}</pre><p>Find your custom endpoint in the <a href="https://console.aws.amazon.com/iot/home?region=us-east-1#/dashboard/help">AWS IoT console</a>. (From the dashboard, in the left navigation pane, choose <strong>Manage</strong>, and then choose <strong>Things</strong>. Select the box representing your button to show its details page. On the details page, in the left navigation pane, choose <strong>Interact</strong> and look for the <strong>HTTPS</strong> section, near the top.) Your endpoint will look something like the following:</p><pre>ABCDEFG1234567.iot.us-east-2.amazonaws.com</pre><p>where ABCDEFG1234567 is the subdomain and us-east-2 is the region.</p><h3>Now the setup part is over! Let the coding beginzzz ! 😅😎</h3><p>React Native has no native components available for our purpose through their regular packages. So I had to look for third party packages out there on the wild wild internet.</p><p>One such package that I came across was <a href="https://www.npmjs.com/package/react-native-mqtt">react-native-mqtt</a>. In this repo they recommend us to use <a href="https://github.com/eclipse/paho.mqtt.javascript">paho.mqtt.javascript</a> due to reasons that are not solved for a very long time! Nevertheless both packages where useless to me (as I am new to React Native and desperate to make MQTT work quickly), these packages didn’t run well with our AWS IoT usage.</p><p>Then came the good times when I found some packages which uses AWS. The packages I came across are:</p><ol><li><a href="https://github.com/jamesjara/react-native-aws-iot-device-shadows">react-native-aws-iot-device-shadows</a> a github repo by jamesjara.</li><li><a href="https://github.com/aws/aws-iot-device-sdk-js">aws-iot-device-sdk-js</a> by aws.</li><li><a href="https://github.com/kmamykin/aws-mqtt#aws-setup-and-security">aws-mqtt</a> another github repo by kmamykin.</li></ol><p>I also found some interesting reading <a href="https://github.com/aws/aws-iot-device-sdk-js/issues/86">here</a>.</p><p>I was testing all these packages on my iPhone 6+ … and all of them failed! But they did give me good knowledge of how AWS IoT and MQTT works.</p><h4>How did I do it then, you ask ? 😔</h4><p>I moved into native (iOS and Android) coding. Yes, I really did that, sorry React Native.</p><p>If you need to know where to look for native SDK’s visit this <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-sdks.html">page</a>.</p><p>AWS has given a nice sample code example <a href="https://github.com/awslabs/aws-sdk-ios-samples/tree/master/IoT-Sample/Swift/">here</a> that works like a charm. We only have to make changes to their constants file about our 3 essential items I’ve mentioned above.</p><p>While starting the subscribe and publish for AWS IOT, the app needs to have a certificate. You can download the certificate from the AWS console. But in this app I prefer to create the certificate(only once) on run time and save it in the local memory to reuse it whenever needed.</p><h4>AWS IoT and iOS-Swift 🍎</h4><p>React Native supports only Objective C codes! But we are going to write the code in Swift. You will have to open the XCode project inside the iOS sub-folder in the React Native project’s workspace. Follow the following steps to implement the functionality.</p><p><strong>Step 1</strong>: Just as the good guys at AWS have in their sample app, initialize cocoapods and install the pod:</p><pre>pod ‘AWSIoT’, ‘~&gt;2.6.0&#39;</pre><p><strong>Step 2</strong>: Create a swift file to write the AWS IoT code. I called it <em>AWSMqtt.swift</em>. As soon as you create this file, XCode will ask you to create a bridge file. Create it, this is important. Your bridge file will of the name <em>&lt;Project name&gt;-Bridging-Header.h</em>. Add the following code to the bridge file.</p><pre>#import &lt;React/RCTBridgeModule.h&gt;</pre><pre>#import &lt;React/RCTEventEmitter.h&gt;</pre><pre>#import &quot;AWSCore.h&quot;</pre><pre>#import &quot;AWSIoT.h&quot;</pre><p><strong>Step 3</strong>: We will also have to create an Objective-C file to link the bridged native code to React Native’s Javascript. Name it the same as the swift file you created before, like: <em>AWSMqtt.m</em>.</p><p><strong>Step 4</strong>: Create AWSConstants.swift file to write the constants for the AWS IoT. Add the following values to it, remember to replace the necessary values of your own.</p><pre>let AWSRegion = AWSRegionType.&lt;your region&gt;//enum</pre><pre>let CognitoIdentityPoolId = &lt;Your Cognito pool id&gt;//String</pre><pre>let CertificateSigningRequestCommonName = &lt;name for the singing request&gt;//String</pre><pre>let CertificateSigningRequestCountryName = &lt;Country name&gt;//String, get it from locale</pre><pre>let CertificateSigningRequestOrganizationName = &lt;Organization’s name&gt;//String</pre><pre>let CertificateSigningRequestOrganizationalUnitName = &lt;Organization’s Unit name&gt;//String</pre><pre>let PolicyName = &lt;Your policy name&gt;//String. The name of the policy you already created for AWS IoT</pre><pre>// This is the endpoint in your AWS IoT console. eg: https://xxxxxxxxxx.iot.&lt;region&gt;.amazonaws.com</pre><pre>let IOT_ENDPOINT = &lt;The IoT endpoint url&gt;//String</pre><p><strong>Step 5</strong>: Take a look at the code <a href="https://gist.github.com/chandraf22/0f1723ca83edc13c06238a807931a224">here</a>. Add only the necessary code for the <em>AWSMqtt.swift</em>.</p><p><strong>Step 6</strong>: Now we need to make sure that the React Native knows what all methods are accessible. In-order to do that add the following code to the <em>AWSMQtt.m</em> file.</p><pre>#import &lt;React/RCTBridgeModule.h&gt;</pre><pre>#import &lt;React/RCTEventEmitter.h&gt;</pre><pre>@interface RCT_EXTERN_MODULE(AWSMqtt, RCTEventEmitter)</pre><pre>RCT_EXTERN_METHOD(setupAAWSMQTT)</pre><pre>RCT_EXTERN_METHOD(connectToAWSMQTT)</pre><pre>RCT_EXTERN_METHOD(publishToAWSMQTT:(NSString *)topic message:(NSString*)message)</pre><pre>RCT_EXTERN_METHOD(subscribeFromAwsMqtt:(NSString*)topic)</pre><pre>RCT_EXTERN_METHOD(unsubscribeTopic:(NSString*)topic)</pre><pre>RCT_EXTERN_METHOD(unsubscribeAllTopics)</pre><pre>@end</pre><p>The code above supports all the methods in AWSMqtt.swift file <a href="https://gist.github.com/chandraf22/0f1723ca83edc13c06238a807931a224">here</a>.</p><p><strong>Step 7</strong>: With step 6 you are all done with the iOS part. Now open your React Native project in your favourite text editor and open the JavaScript file you need to implement AWS IoT. Now add the following items to the React Native import.</p><ol><li>NativeModules</li><li>NativeEventEmitter</li><li>DeviceEventEmitter</li></ol><pre>import {NativeModules, NativeEventEmitter, DeviceEventEmitter} from &quot;react-native&quot;;</pre><p>Add the constants like:</p><pre>const { IoTModule } = NativeModules;//For android</pre><pre>const AWSMqttEvents = new NativeEventEmitter(NativeModules.AWSMqtt);//for ios</pre><p><strong>Step 8</strong>: To initialize AWS IoT for iOS devices,</p><pre>//Add necessary Listeners</pre><pre>AWSMqttEvents.addListener(</pre><pre>&quot;connectionStatus&quot;,</pre><pre>this.handleMqttStatusChange</pre><pre>);</pre><pre>AWSMqttEvents.addListener(&quot;message&quot;, this.handleMessage);</pre><pre>//Setup Mqtt</pre><pre>NativeModules.AWSMqtt.setupAAWSMQTT();//implemented in AWSMqtt.swift</pre><pre>setTimeout(() =&gt; {</pre><pre>//Establish Mqtt Connection</pre><pre>NativeModules.AWSMqtt.connectToAWSMQTT();//implemented in AWSMqtt.swift</pre><pre>}, 500);</pre><pre>//Handle changes for the MQTT Connection</pre><pre>handleMqttStatusChange(params) {</pre><pre>console.log(&quot;Connection Status&quot;, params);</pre><pre>}</pre><pre>//Process the MQTT datahere.</pre><pre>handleMessage(message) {</pre><pre>console.log(&quot;message: &quot;, message);<br>}</pre><p>This will setup and connect the AWS IoT. As you can see there is 500ms delay between calling setup and connect calls. This is because of the actual time delay experienced in setting up the AWS IoT. After connect wait for another second to make the subscribe and publish calls. Delays are only needed when you are executing all these code in one shot.</p><p><em>To Subscribe to a particular MQTT topic</em>:</p><pre>NativeModules.AWSMqtt.subscribeFromAwsMqtt(&lt;topic&gt;);</pre><p><em>To UnSubscribe from a MQTT topic</em>:</p><pre>NativeModules.AWSMqtt.unsubscribeTopic(&lt;topic&gt;);</pre><p><em>To UnSubscribe all MQTT topics</em>:</p><pre>NativeModules.AWSMqtt.unsubscribeAllTopics();</pre><p><em>To Publish to a MQTT topic</em>:</p><pre>NativeModules.AWSMqtt.publishToAWSMQTT(&lt;topic&gt;, &lt;message&gt;);</pre><p>We can now run the iOS app successfully!</p><h4>AWS IoT and Android-Java. 🤖</h4><p>I am an iOS Developer, so most of the code written for the Android part of AWS IoT, was by my friend <a href="http://twitter.com/SriHarish_60989">@SriHarish_60989</a>. Here is how it works:</p><p><strong>Step 1</strong>: Update the <em>MainApplication.java</em>’ s “<em>getpackages”</em> function by adding</p><pre>new MainReactPackage(),</pre><pre>new AwsIoTPackage(),</pre><p><strong>Step 2</strong>: We have to create the package “<em>AwsIoTPackage</em>”. Create <em>AwsIotPackage.java</em> like we have done <a href="https://gist.github.com/chandraf22/340f243206153c318a3da493914b95be">here</a>. Add this file in the same folder as the MainApplication.java.</p><p><strong>Step 3</strong>: Create a new java file on the same folder. We called it <em>AwsIoTModule.java</em>. Refer the code <a href="https://gist.github.com/chandraf22/70bd747b8f08f32698e457365f4f3866">here</a> to create your own module and make the necessary changes for the constants that you need to add.</p><p><strong>Step 4</strong>: With the above 3 steps and codes you can implement the Java code. Now open the React Native project and write necessary code from <strong>Step 7</strong> of iOS AWS IoT. The DeviceEventEmitter is the component needed for Android. Also don’t forget to add the constant:</p><pre>const { IoTModule } = NativeModules;//For android</pre><p><strong>Step 5</strong>: To initialize AWS IoT in Android devices:</p><pre>//Add necessary Listeners</pre><pre>DeviceEventEmitter.addListener(&quot;Status&quot;, this.handleMqttStatusChange);</pre><pre>DeviceEventEmitter.addListener(&quot;subscribe&quot;, this.handleDriverData);</pre><pre>//Setup Mqtt</pre><pre>setTimeout(() =&gt; {</pre><pre>console.log(&quot;Initialise Aws Mqtt&quot;);</pre><pre>IoTModule.initializeAWSMqtt();</pre><pre>}, 1500);</pre><pre>//Establish Mqtt Connection</pre><pre>setTimeout(() =&gt; {</pre><pre>IoTModule.connectAWSMqtt();</pre><pre>}, 3000);</pre><p>The delays are necessary due to the initialisation process, only needed when you are executing all these code in one shot.</p><p>To Subscribe to a particular MQTT topic/channel:</p><pre>IoTModule.subscribe(&lt;topic&gt;);</pre><p>To UnSubscribe a MQTT topic/channel:</p><pre>IoTModule.unsubscribe(&lt;topic&gt;);</pre><p>To UnSubscribe all the MQTT channels/topics:</p><pre>IoTModule.unsubscribeAll();</pre><p><em>To Publish to a MQTT topic</em>:</p><pre>IoTModule.publish(&lt;topic&gt;, &lt;message&gt;);</pre><p>That’s it for the Android part.</p><h3>How to test the code? 😈</h3><p>Open AWS IoT Console, take a look at the panel on the left side of the page. The last option is <em>Test</em>. Open it. The page itself is self explanatory. You can subscribe and publish from the same page.</p><h3>Stuff that I would love to have: ❤️</h3><ol><li>An nice React Native package to do this, instead of writing the code for both iOS and Android separately. The package should have a sample project and step by step details on how to implement it.</li></ol><h3>Why write this article? 🤔</h3><p>I was new to React Native and started working on this topic without any knowledge. While working on this topic I always wanted get a article like this to help me around, but there were none.</p><h3>Some interesting reads, links and references: 🧐</h3><ol><li><a href="https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices">https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices</a></li><li><a href="http://www.steves-internet-guide.com/understanding-mqtt-topics/">http://www.steves-internet-guide.com/understanding-mqtt-topics/</a></li><li><a href="https://www.youtube.com/watch?v=jZL4uohxuPc&amp;feature=youtu.be">https://www.youtube.com/watch?v=jZL4uohxuPc&amp;feature=youtu.be</a></li><li><a href="https://diyprojects.io/8-online-mqtt-brokers-iot-connected-objects-cloud/">https://diyprojects.io/8-online-mqtt-brokers-iot-connected-objects-cloud/</a></li><li><a href="https://docs.aws.amazon.com/iot/latest/developerguide/configure-iot.html">https://docs.aws.amazon.com/iot/latest/developerguide/configure-iot.html</a></li><li><a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-gs.html">https://docs.aws.amazon.com/iot/latest/developerguide/iot-gs.html</a></li><li><a href="https://github.com/jamesjara/react-native-aws-iot-device-shadows">https://github.com/jamesjara/react-native-aws-iot-device-shadows</a></li><li><a href="https://docs.aws.amazon.com/iot/latest/developerguide/view-mqtt-messages.html">https://docs.aws.amazon.com/iot/latest/developerguide/view-mqtt-messages.html</a></li><li><a href="https://github.com/aws/aws-iot-device-sdk-js/issues/86">https://github.com/aws/aws-iot-device-sdk-js/issues/86</a></li><li><a href="https://github.com/awslabs/aws-sdk-ios-samples/tree/master/IoT-Sample/Swift/">https://github.com/awslabs/aws-sdk-ios-samples/tree/master/IoT-Sample/Swift/</a></li><li><a href="https://github.com/awslabs/aws-sdk-android-samples">https://github.com/awslabs/aws-sdk-android-samples</a></li><li><a href="https://teabreak.e-spres-oh.com/swift-in-react-native-the-ultimate-guide-part-1-modules-9bb8d054db03">https://teabreak.e-spres-oh.com/swift-in-react-native-the-ultimate-guide-part-1-modules-9bb8d054db03</a></li></ol><p>Thanks to <a href="https://medium.com/@murtazz?source=post_page">Murtuza Kutub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55799df7b4b6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/f22labs/aws-iot-and-react-native-i-love-you-but-you-can-do-better-55799df7b4b6">AWS IoT and React Native, I love you, but you can do better.</a> was originally published in <a href="https://medium.com/f22labs">F22 Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting to preferred WiFi without leaving the app in iOS 11.]]></title>
            <link>https://medium.com/@Chandrachudh/connecting-to-preferred-wifi-without-leaving-the-app-in-ios-11-11f04d4f5bd0?source=rss-e8aa989cf106------2</link>
            <guid isPermaLink="false">https://medium.com/p/11f04d4f5bd0</guid>
            <category><![CDATA[ios-11]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[network-extension]]></category>
            <category><![CDATA[wifi]]></category>
            <category><![CDATA[iot]]></category>
            <dc:creator><![CDATA[Chandrachudh K]]></dc:creator>
            <pubDate>Tue, 03 Apr 2018 10:52:59 GMT</pubDate>
            <atom:updated>2018-09-05T09:20:19.301Z</atom:updated>
            <content:encoded><![CDATA[<p>With iOS 11 Apple included public APIs that we can use to programmatically join a WiFi without leaving your app. Not many people have noticed about it (that’s what I think! coz I didn’t notice it until recently!), so I thought like writing an article about it!</p><p>This operation is done with the help of NEHotspotConfigurationManager<em>.</em></p><p><strong>Step 1:</strong> Create a new project.</p><p><strong>Step 2:</strong> Goto your project’s capabilities section and add the <em>Network Extensions </em>&amp; <em>Hotspot Configuration </em>capabilities. This will add the <em>{your_project_name}.entilements</em> file to your project. Remember this is one of the most important steps here. If by any means this file is not included in your project and your app is crashing here and there, then you know where to look!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PVCwepZgj7pIhRfJBXHl-A.png" /><figcaption>Step 2, enable capabilites</figcaption></figure><p><strong>Step 3:</strong> Goto your viewcontroller of choice! import the <em>NetworkExtension </em>there.</p><pre>import NetworkExtension</pre><p><strong>Step 4:</strong> From now on we are going to use the NEHotspotConfiguration &amp; NEHotspotConfigurationManager<em> </em>classes. I assume that you already know the SSID(WiFi name) to which you want to connect to. You can connect to both SSID’s with or without a passphrase, but the methods used are slightly different. Now create your new NEHotspotConfiguration<em> </em>object.</p><pre>let hotspotConfig = NEHotspotConfiguration(ssid: SSID)//Unsecured connections<br>//OR<br>let hotspotConfig = NEHotspotConfiguration(ssid: SSID, passphrase: passphrase, isWEP: false)//Secured connections</pre><p>The method returns a NEHotspotConfiguration<em> </em>object. It contains Configuration settings for a Wi-Fi network hotspot.</p><p>The NEHotspotConfigurationclass contains configuration properties and credentials required to connect to Wi-Fi networks.</p><p>The parameter <em>ssid </em>is the name of your WiFi/Hotspot. For further information on both methods you can do ‘Option + Click’ on the method in xcode.</p><p><strong>Step 5:</strong> The NEHotspotConfigurationManager<em> </em>is a singleton class. Use the code below to create the connection:</p><pre>NEHotspotConfigurationManager.shared.apply(hotspotConfig) {[unowned self] (error) in<br>   if let error = error {<br>      print(&quot;error = &quot;,error)<br>   }<br>   else {<br>      print(&quot;Success!&quot;)<br>   }<br>}</pre><p>Voila! its done the app will now ask the user to confirm the action and now will connect to the WiFi/Hotspot.</p><p>Apple has also provided a way to remove the network configuration:</p><pre>NEHotspotConfigurationManager.shared.removeConfiguration(forSSID: SSID)</pre><p>List all the networks already configured:</p><pre>NEHotspotConfigurationManager.shared.getConfiguredSSIDs { (ssidsArray) in<br>   for ssid in ssidsArray {<br>      print(&quot;ssid = &quot;,ssid)<br>   }<br>}</pre><h3><strong>Things that you should take care of (Or the mistakes I made during the trial run!)</strong></h3><ol><li>If the SSID has spaces and other blank spaces and you enter it as it is — it will not work!</li><li>If the is a typo in the SSID you entered it will create a configuration but you won’t be able to connect.</li><li>You cannot run this in the simulator.</li><li>Your device should be running iOS 11.* or greater and your should be xcode 9.* or greater.</li><li>When you try to configure a network which is already configured — you will get an error.</li><li>Once you delete the app the configurations related to that app is also gone, poof!…</li></ol><h3><strong>Stuff that I would love to have:</strong></h3><ol><li>A way to list all the networks that are not associated with the app.</li><li>A way to connect again with the already existing configurations.</li></ol><h3><strong>You can explore more from here:</strong></h3><ul><li><a href="https://developer.apple.com/documentation/networkextension/nehotspotconfigurationmanager">NEHotspotConfigurationManager</a></li><li>kraigspear’s <a href="https://gist.github.com/kraigspear/ee53b869f9c292f0d02c466a17f63e80">GIST</a></li></ul><h3><strong>Background for the ariticle</strong></h3><p>I am trying to build an IoT project with iOS for F22Labs and stumbled upon on the existence of <strong><em>NEHotspotConfigurationManager</em></strong> &amp; <strong><em>NetworkExtension .</em></strong> Once I’ve explored more I will publish another article.</p><h3>Tips &amp; Tricks</h3><p>Creating a video of your iOS app running in the Xcode simulator is as simple running the following from a terminal on macOs:</p><pre>xcrun simctl io booted recordVideo filename.mov</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11f04d4f5bd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>