<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gowthaman Ravichandran</title>
    <description>The latest articles on DEV Community by Gowthaman Ravichandran (@gowthaman_ravichandran_c5).</description>
    <link>https://dev.to/gowthaman_ravichandran_c5</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2663480%2Fead018e8-5c0b-495a-b9ff-0268149e6c0a.png</url>
      <title>DEV Community: Gowthaman Ravichandran</title>
      <link>https://dev.to/gowthaman_ravichandran_c5</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gowthaman_ravichandran_c5"/>
    <language>en</language>
    <item>
      <title>How to Manage Cookies?</title>
      <dc:creator>Gowthaman Ravichandran</dc:creator>
      <pubDate>Mon, 27 Jan 2025 15:52:07 +0000</pubDate>
      <link>https://dev.to/gowthaman_ravichandran_c5/how-to-manage-cookies-3a8h</link>
      <guid>https://dev.to/gowthaman_ravichandran_c5/how-to-manage-cookies-3a8h</guid>
      <description>&lt;p&gt;I’m using the following code to launch a login page in my Flutter app via native Android code using CustomTabsIntent:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;val customTabsIntent = CustomTabsIntent.Builder().build()&lt;br&gt;
customTabsIntent.launchUrl(this, Uri.parse(loginUrl))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I want to manage cookies for the browser session opened using CustomTabsIntent. Specifically:&lt;/p&gt;

&lt;p&gt;Add cookies (e.g., session tokens) before launching the URL.&lt;br&gt;
Delete specific cookies or clear all cookies after the session.&lt;/p&gt;

&lt;p&gt;I came across CookieManager in Android’s WebKit, but I’m unsure how to integrate it with CustomTabsIntent. Could someone guide me on how to:&lt;/p&gt;

&lt;p&gt;Set cookies before launching the URL.&lt;br&gt;
Delete existing cookies or clear cookies programmatically.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Clearing Cookies of CustomTabsIntent</title>
      <dc:creator>Gowthaman Ravichandran</dc:creator>
      <pubDate>Fri, 24 Jan 2025 13:06:46 +0000</pubDate>
      <link>https://dev.to/gowthaman_ravichandran_c5/clearing-cookies-of-customtabsintent-2bil</link>
      <guid>https://dev.to/gowthaman_ravichandran_c5/clearing-cookies-of-customtabsintent-2bil</guid>
      <description>&lt;p&gt;I'm using CustomTabsIntent to launch my app's login page in a custom tab, but I need to clear the browser cookies when the login fails or when I encounter any issues. I have tried a few approaches to achieve this, but none seem to work.&lt;/p&gt;

&lt;p&gt;Here’s the code I'm using to launch the browser:&lt;/p&gt;

&lt;p&gt;val customTabsIntent = CustomTabsIntent.Builder().build()&lt;br&gt;
customTabsIntent.launchUrl(this, Uri.parse(loginUrl))&lt;/p&gt;

&lt;p&gt;And this is the code I tried to clear the cookies:&lt;/p&gt;

&lt;p&gt;val cookieManager = CookieManager.getInstance()&lt;br&gt;&lt;br&gt;
cookieManager.removeAllCookies(null)&lt;br&gt;&lt;br&gt;
cookieManager.flush()&lt;/p&gt;

&lt;p&gt;How can I clear the cookies of the browser that is opened using CustomTabsIntent?&lt;/p&gt;

</description>
      <category>android</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Handling PathAccessException in iOS for File Download</title>
      <dc:creator>Gowthaman Ravichandran</dc:creator>
      <pubDate>Wed, 08 Jan 2025 15:52:02 +0000</pubDate>
      <link>https://dev.to/gowthaman_ravichandran_c5/handling-pathaccessexception-in-ios-for-file-download-57cp</link>
      <guid>https://dev.to/gowthaman_ravichandran_c5/handling-pathaccessexception-in-ios-for-file-download-57cp</guid>
      <description>&lt;p&gt;In my Flutter application, I have implemented a feature that allows users to download a document and save it to a location of their choice. The process involves:&lt;/p&gt;

&lt;p&gt;Using the FilePicker package to let the user select a directory.&lt;br&gt;
Saving the file using File.writeAsBytes after the directory is selected.&lt;/p&gt;

&lt;p&gt;This approach works perfectly on Android, but on iOS, I encounter a PathAccessException when attempting to save the file to the selected directory, likely due to platform-specific restrictions on file system access.&lt;/p&gt;

&lt;p&gt;Below is the code for reference:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;final String selectedDirectory = await FilePicker.platform.getDirectoryPath() ?? '';if (selectedDirectory.isNotEmpty) {&lt;br&gt;
  final String filePath = '$selectedDirectory/$fileName$ext';&lt;br&gt;
  final File file = File(filePath);&lt;br&gt;
  await file.writeAsBytes(fileData);&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;What changes or permissions are required to enable writing files to a user-selected directory on iOS? Is there an alternative approach to achieve this functionality on iOS?&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>ios</category>
      <category>dart</category>
      <category>filepermissions</category>
    </item>
    <item>
      <title>How to Clear Cookies in Flutter Custom Tabs?</title>
      <dc:creator>Gowthaman Ravichandran</dc:creator>
      <pubDate>Mon, 06 Jan 2025 11:28:19 +0000</pubDate>
      <link>https://dev.to/gowthaman_ravichandran_c5/how-to-clear-cookies-in-flutter-custom-tabs-18j2</link>
      <guid>https://dev.to/gowthaman_ravichandran_c5/how-to-clear-cookies-in-flutter-custom-tabs-18j2</guid>
      <description>&lt;p&gt;I am using the flutter_custom_tabs package to open a URL in my Flutter app. I need to clear the cookies stored in the browser when the custom tabs browser is closed. &lt;/p&gt;

&lt;p&gt;I used a native method (Kotlin for Android, swift for iOS) to clear cookies, but it didn’t work as expected. Although the native scripts executed correctly when called from Flutter, the cookies in the custom tabs browser remained uncleared.&lt;/p&gt;

&lt;p&gt;Below is the native code I used:&lt;/p&gt;

&lt;p&gt;Android:&lt;br&gt;
&lt;code&gt;privatefun clearBrowserCache() {&lt;br&gt;
        WebView(this).clearCache(true)&lt;br&gt;
        CookieManager.getInstance().removeAllCookies(null)&lt;br&gt;
        WebStorage.getInstance().deleteAllData()&lt;br&gt;
    }&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;iOS:&lt;br&gt;
&lt;code&gt;privatefuncclearBrowserCache() {&lt;br&gt;
let dataStore =WKWebsiteDataStore.default()&lt;br&gt;
let dataTypes =WKWebsiteDataStore.allWebsiteDataTypes()&lt;br&gt;
let dateFrom =Date(timeIntervalSince1970: 0)&lt;br&gt;
        dataStore.removeData(ofTypes: dataTypes, modifiedSince: dateFrom, completionHandler: {})&lt;br&gt;
    }&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Is there a way to clear the cookies of the browser opened with flutter_custom_tabs? Or is there any workaround or alternative solution to achieve this functionality?&lt;/p&gt;

</description>
      <category>browser</category>
      <category>cookie</category>
      <category>flutter</category>
      <category>mobile</category>
    </item>
  </channel>
</rss>
