<?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 Sasikumar G on Medium]]></title>
        <description><![CDATA[Stories by Sasikumar G on Medium]]></description>
        <link>https://medium.com/@sasikumargios?source=rss-9403180699e8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2iTjkh6yPXp-_9kCvIz-iw@2x.jpeg</url>
            <title>Stories by Sasikumar G on Medium</title>
            <link>https://medium.com/@sasikumargios?source=rss-9403180699e8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 13:29:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sasikumargios/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[Managing Multiple Git Accounts with SSH Authorization]]></title>
            <link>https://medium.com/@sasikumargios/managing-multiple-git-accounts-with-ssh-authorization-c2bf641ce79e?source=rss-9403180699e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2bf641ce79e</guid>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[multiple-ssh-keys]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[ssh-keys]]></category>
            <category><![CDATA[source-control]]></category>
            <dc:creator><![CDATA[Sasikumar G]]></dc:creator>
            <pubDate>Thu, 18 Apr 2024 09:56:40 GMT</pubDate>
            <atom:updated>2024-04-18T10:08:25.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8SnLgKXwvAqyxuaE" /><figcaption>Photo by <a href="https://unsplash.com/@synkevych?utm_source=medium&amp;utm_medium=referral">Roman Synkevych</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Introduction</strong></p><p>In the evolving landscape of software development, it&#39;s common for developers to manage multiple Git accounts for personal and professional projects. This guide provides a detailed walkthrough for setting up SSH keys for multiple Git accounts, ensuring secure and streamlined access to your repositories.</p><p><strong>Step 1: Generating SSH Keys</strong></p><p>Begin by generating SSH keys for your personal account. This step is critical for establishing a secure connection between your machine and Git repositories.</p><ul><li>Generate SSH Keys: Follow the instructions on GitHub’s documentation to create a new SSH key: <a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent"><em>Generating a New SSH Key</em></a><em>.</em></li><li>Key Naming: When prompted, enter a filename for your key that clearly indicates its use, such as /Users/YOUR_USERNAME/.ssh/personal for personal projects.</li></ul><p><strong>Step 2: Adding SSH Keys to Your Account</strong></p><p>Once you have generated your SSH keys, you need to add them to your Git account to establish a connection.</p><ul><li>Add SSH Key to GitHub: Use the guide provided by GitHub to add your new SSH key to your account: <a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account">Adding a New SSH Key</a>.</li><li>Repeat the process for your work account (for instance, with company1), ensuring each key is uniquely named (e.g., /Users/YOUR_USERNAME/.ssh/company1).</li></ul><p><strong>Step 3: Configuring SSH for Multiple Accounts</strong></p><p>With your SSH keys in place, the next step is to configure your SSH client to manage multiple identities:</p><ul><li>Navigate to your SSH configuration file in your home directory (~/.ssh/config) and add entries for each account:</li></ul><pre># Personal account<br>Host github.com-personal<br>  HostName github.com<br>  User git<br>  IdentityFile ~/.ssh/personal<br><br># Work account<br>Host github.com-company1<br>  HostName github.com<br>  User git<br>  IdentityFile ~/.ssh/company1</pre><p><strong>Step 4: Ensuring Proper SSH Key</strong></p><p>Permissions and Loading Security is paramount, so ensure your SSH keys are properly secured and loaded into your SSH agent:</p><ul><li><strong>Set Key Permissions:</strong> Ensure your keys are not publicly readable:</li></ul><pre>chmod 600 ~/.ssh/personal<br>chmod 600 ~/.ssh/company1</pre><ul><li><strong>Load SSH Key:</strong> Add your SSH key to the SSH agent, ensuring it’s running:</li></ul><pre>eval `ssh-agent -s`<br>ssh-add ~/.ssh/personal<br>ssh-add ~/.ssh/company1</pre><p><strong>Step 5: Testing and Using Your SSH Configuration</strong></p><p>Finally, verify that your SSH setup is functioning correctly:</p><ul><li><strong>Test SSH Connection</strong>:</li></ul><pre>ssh -T -v git@github.com-personal<br>ssh -T -v git@github.com-company1</pre><p><strong>Step 6: Clone Repositories Using SSH:</strong></p><pre>git clone git@github.com-personal:YourUsername/YourRepository.git<br>git clone git@github.com-company1:YourWorkUsername/YourWorkRepository.git</pre><blockquote>Note: Already cloned repos needs url change like below</blockquote><pre>git remote set-url origin git@github.com-personal:YourUsername/YourRepository.git</pre><p><strong>Conclusion</strong></p><p>By following these detailed steps, developers can manage multiple Git accounts efficiently, maintaining security and clarity across personal and professional projects. This setup not only facilitates smoother project management but also enhances your operational security in handling multiple repositories.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2bf641ce79e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Push Notifications in iOS with Firebase]]></title>
            <link>https://medium.com/@sasikumargios/implementing-push-notifications-in-ios-with-firebase-017a434d3ade?source=rss-9403180699e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/017a434d3ade</guid>
            <category><![CDATA[push-notification-ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[firebasepushnotification]]></category>
            <dc:creator><![CDATA[Sasikumar G]]></dc:creator>
            <pubDate>Sat, 13 Apr 2024 06:26:41 GMT</pubDate>
            <atom:updated>2024-04-13T07:15:58.325Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4BOkPaTF9DJqjcbTYW9OoA.jpeg" /></figure><p>Push notifications are essential for engaging users and delivering timely information. This guide explains how to integrate Firebase Cloud Messaging (FCM) into your iOS application, manage permissions, and handle token refreshes and deregistration.</p><h3>1. Adding Firebase to Your iOS Project</h3><p>Before you can handle push notifications, you must add Firebase to your project. Firebase provides a comprehensive suite of features that are easy to integrate.</p><h4>Adding the Pod for Push Notifications</h4><p>First, you need to add Firebase Messaging to your project via CocoaPods. If you haven’t installed CocoaPods yet, you can do so by running the following command in your terminal:</p><pre>sudo gem install cocoapods</pre><p>Then, create a Podfile in your project directory (if one does not already exist) by running:</p><pre>pod init</pre><p>Add the Firebase Messaging pod to your Podfile:</p><pre>platform :ios, &#39;14.0&#39;<br><br>target &#39;AppTargets&#39; do<br>  use_frameworks!<br>  pod &#39;Firebase/Messaging&#39;<br>end</pre><p>Run pod install to install the new pod and open your project in Xcode from the .xcworkspace file to start using the pods.</p><h3>2. Requesting Notification Permissions</h3><h4>How and When to Ask for Permissions</h4><p>It’s best to ask for notification permissions at a point in your app when users will understand why they are receiving notifications. Commonly, this is done after explaining the benefits they will gain from enabling notifications.</p><h4>Code for Requesting Permissions</h4><p>Here’s how you can request notification permissions in iOS:</p><h4>2.a Check Current Notification Settings</h4><p>Before deciding to prompt the user for notification permissions, it’s a good practice to check the current authorization status. This helps ensure that you only ask for permissions when necessary and respect the user’s previous decisions:</p><pre><br>import UserNotifications<br><br>func checkAndRequestPush() {<br>    <br>    UNUserNotificationCenter.current().getNotificationSettings { [weak self] settings in<br>        if settings.authorizationStatus == .notDetermined {<br>            // The user has not yet made a choice regarding whether your app can show notifications<br>            DispatchQueue.main.async {<br>                // Call your function to request permission here<br>                self.requestNotificationPermission()<br>            }<br>        } else if settings.authorizationStatus == .denied {<br>            // The user has denied notifications<br>            // You might want to alert the user that they need to enable them manually if your app depends on notifications<br>        } else if settings.authorizationStatus == .authorized {<br>            // The app is already authorized to display notifications, no need to prompt again<br>        }<br>    }<br>    <br>}</pre><h4>2.b Requesting Permission</h4><p>Only when the status is .notDetermined should you proceed to request permissions. Here is how you can request notification permissions from the user:</p><pre>func requestNotificationPermission() {<br>    let center = UNUserNotificationCenter.current()<br>    center.requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in<br>        if granted {<br>            print(&quot;Notification permission granted.&quot;)<br>            DispatchQueue.main.async {<br>                UIApplication.shared.registerForRemoteNotifications()<br>            }<br>        } else if let error = error {<br>            print(&quot;Notification permission denied due to error: \(error.localizedDescription).&quot;)<br>        } else {<br>            print(&quot;Notification permission denied.&quot;)<br>        }<br>    }<br>}</pre><h4>2.c Guiding Users to Open Settings</h4><p>If the user has denied permissions previously, you might want to guide them to the settings app to enable notifications manually:</p><pre>func showAlertToOpenSettings() {<br>        //DispatchQueue.main.asyncAfter - rootViewController will be nil and so added a delay - Not recommended though<br>        DispatchQueue.main.asyncAfter(deadline: .now() + 5, execute: DispatchWorkItem.init(block: {<br>            let alert = UIAlertController(title: &quot;Enable Notifications&quot;,<br>                                          message: &quot;Notifications are turned off. Enable them in your settings to get the full experience.&quot;,<br>                                          preferredStyle: .alert)<br>            let settingsAction = UIAlertAction(title: &quot;Settings&quot;, style: .default) { (_) -&gt; Void in<br>                guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else {<br>                    return<br>                }<br>                if UIApplication.shared.canOpenURL(settingsUrl) {<br>                    UIApplication.shared.open(settingsUrl, completionHandler: nil)<br>                }<br>            }<br>            let cancelAction = UIAlertAction(title: &quot;Cancel&quot;, style: .cancel, handler: nil)<br>            alert.addAction(settingsAction)<br>            alert.addAction(cancelAction)<br>            UIApplication.shared.keyWindow?.rootViewController?.present(alert, animated: true, completion: nil)<br>        }))<br>    }</pre><h3>3. Setting the Messaging Delegate</h3><p>To receive messages and handle tokens effectively, set the messaging delegate in your AppDelegate:</p><pre>import FirebaseMessaging<br><br>func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {<br>    FirebaseApp.configure()<br>    Messaging.messaging().delegate = self<br>    return true<br>}<br><br>extension AppDelegate: MessagingDelegate {<br>    func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {<br>        print(&quot;Firebase registration token: \(fcmToken)&quot;)<br>        guard let fcmToken = fcmToken else { return }<br>        // Send the FCM token to your server to store it for future use<br>        sendTokenToServer(token: fcmToken)<br>    }  <br>}<br><br>    func sendTokenToServer(token: String) {<br>        // Implement network request to send token to your server<br>    }<br>}</pre><h4>Notification Settings vs. Token Reception</h4><blockquote>Notification Disabled in Settings: Even if notifications are disabled in the iOS settings, your app will still receive an FCM token. Disabling notifications only prevents alerts, banners, and sounds from being shown; it does not prevent tokens from being issued or messages from being received as silent notifications.</blockquote><blockquote>Token Refresh: The FCM token can refresh due to app reinstalls, updates, or at Firebase’s discretion. Monitor messaging(_:didReceiveRegistrationToken:) to handle token updates properly.</blockquote><blockquote>When to Deregister: If your users log out, consider deregistering for notifications by stopping the token’s association with the user on your backend to prevent notifications from being sent to someone who no longer uses the device.</blockquote><pre>UIApplication.shared.unregisterForRemoteNotifications()</pre><h4>4. Remember to enable Push notifications in your app settings</h4><p>Please refer to the image below to enable the highlighted option from your application target’s capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x88q8X_AU2AR6QO2ESIfyw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=017a434d3ade" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>