<?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 Tugba Çekirge on Medium]]></title>
        <description><![CDATA[Stories by Tugba Çekirge on Medium]]></description>
        <link>https://medium.com/@tugbacekirge?source=rss-32318402cb34------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-UA3DXqKcx1D9eYlV8O6SQ.png</url>
            <title>Stories by Tugba Çekirge on Medium</title>
            <link>https://medium.com/@tugbacekirge?source=rss-32318402cb34------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 10:30:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tugbacekirge/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[I Just Wanted to Try: My AI Art Journey on Gumroad]]></title>
            <link>https://medium.com/@tugbacekirge/i-just-wanted-to-try-my-ai-art-journey-on-gumroad-ccaaa2cf6259?source=rss-32318402cb34------2</link>
            <guid isPermaLink="false">https://medium.com/p/ccaaa2cf6259</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-art-gallery]]></category>
            <category><![CDATA[ai-art]]></category>
            <dc:creator><![CDATA[Tugba Çekirge]]></dc:creator>
            <pubDate>Thu, 22 May 2025 20:38:53 GMT</pubDate>
            <atom:updated>2025-05-22T20:38:53.225Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m not a professional artist. I didn’t study art. I don’t even think of myself as “creative” in the traditional sense. But I <em>feel</em> things. And sometimes, those feelings come out in colors, textures, light, and shadow — through images I create using AI tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X-6HViuzLSLZ7ocokDGEOw.jpeg" /><figcaption><em>Celestial Descent</em> captures a powerful moment: a lone warrior standing at the edge of a crumbling world as the cosmos explodes into chaos.</figcaption></figure><blockquote>“AI art isn’t real art.”</blockquote><p>You’re probably right.<br> But that doesn’t stop me from loving it.<br> And it doesn’t stop me from wanting to share what I make.</p><p>I started generating images simply because it made me happy. I’d see a prompt in my head and try to turn it into something visual. Some of them are weird. Some are moody. Some even surprised me. And one day, I thought: <em>why not put them somewhere?</em></p><p>So I made a <a href="https://turtlepile.gumroad.com/"><strong>Gumroad </strong></a>page.<br>Not to make money (although hey, if someone buys something, that’s cool too). But mostly because I wanted a little corner of the internet to say:<br>“Hey. I made this. It meant something to me.”<br>Maybe it’ll mean something to someone else, too.</p><p>So far, I’ve made <strong>4 sales</strong>.<br>All from friends.<br>🥲 Yeah, I know.</p><p>I’m at the very beginning.<br>Maybe I’ll give up soon and close it all.<br>Or maybe, just maybe, I’ll keep going.</p><p>This is my little experiment in sharing.<br>If you’re curious, you can check it out here:</p><p><a href="https://turtlepile.gumroad.com/">Subscribe to Tugba Çekirge on Gumroad</a></p><p>Thanks for being here.<br> No pressure. No pitch.<br> Just feelings in image form.</p><p>Here are a few of my personal favorites , each one means something to me, in ways I can’t always explain with words:</p><p>🎨 <a href="https://turtlepile.gumroad.com/l/CrimsonWasteland">Crimson Wasteland</a><br> The apocalypse wears a long coat.</p><p>🔥 <a href="https://turtlepile.gumroad.com/l/ElementalWrath">Elemental Wrath</a><br> Master of flame and storm.</p><p>☁️ <a href="https://turtlepile.gumroad.com/l/HeavenlyPath">Heavenly Path</a><br> Where stars align and angels rise, a path of light begins.</p><p>I don’t know where this leads. I just wanted to see what happens if I try.<br> Thanks for reading.<br> And if you’ve ever wanted to share your weird little passion too, this is your sign. 🌱</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccaaa2cf6259" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Offline First Approach With Flutter]]></title>
            <link>https://medium.com/codebrew/offline-first-approach-with-flutter-ace2843d36d8?source=rss-32318402cb34------2</link>
            <guid isPermaLink="false">https://medium.com/p/ace2843d36d8</guid>
            <category><![CDATA[cross-platform]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[offline-first]]></category>
            <dc:creator><![CDATA[Tugba Çekirge]]></dc:creator>
            <pubDate>Wed, 14 Jun 2023 00:13:21 GMT</pubDate>
            <atom:updated>2023-06-14T00:44:58.088Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello!</p><p>My name is <a href="https://www.linkedin.com/in/tugbacekirge/">Tugba</a>; I am acting as a software development team lead at<a href="https://www.linkedin.com/company/arkitek-net/"> Arkitek R&amp;D</a>. In Arkitek, we are building mobile, desktop, and web applications using technologies such as <a href="https://vuejs.org/"><strong>VueJS</strong></a>, <a href="https://flutter.dev/"><strong>Flutter</strong></a><strong>, </strong>and <a href="https://docs.microsoft.com/en-us/dotnet/csharp/"><strong>C#</strong></a>. Since 2021, we have been developing our web/mobile projects in Flutter, and needless to say, Flutter is fantastic. After two years, we hived many know-how and some workarounds and I will try to share whenever I find a chance.</p><p>If you like my content, you can <a href="http://buymeacoffee.com/turtlepile">buy me a p</a>izza!</p><p>Before we begin, I would like to express my gratitude to the <a href="https://twitter.com/flutterankara">Flutter Ankara</a> team for extending the invitation to us. We had an amazing time! It was a pleasure to be a part of the event, and we look forward to meeting again in future gatherings. Thank you once again for the opportunity! ❤</p><h3>Flutter Ankara on Twitter: &quot;Flutter Şöleni&#39;nden @tugbacekirge &#39;nin &quot;Offline first approach in Flutter&quot; sunumu 💙#flutter pic.twitter.com/Q5XB9ZXprO / Twitter&quot;</h3><p>Flutter Şöleni&#39;nden @tugbacekirge &#39;nin &quot;Offline first approach in Flutter&quot; sunumu 💙#flutter pic.twitter.com/Q5XB9ZXprO</p><h4>What is Offline First?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lm1PF-Hx3AufF2vU483GwA.png" /></figure><p>In this article, I will try to explain these topics:</p><ol><li><strong>Offline-first application</strong>: I will discuss the concept of an offline-first application, highlighting its benefits and key characteristics. This approach prioritizes offline functionality and data availability, ensuring a seamless user experience even in the absence of an internet connection.</li><li><strong>Sqflite</strong>: I will explain Sqflite, a popular local database solution for Flutter applications. This section will cover its features, advantages, and suitability for creating relational databases.</li><li><strong>Designing our application</strong> (Arkitek DORS): This section will provide an overview of how we designed our application, named Arkitek DORS. I will discuss the architectural considerations, such as data synchronization, connection monitoring, and cache management, that enable an effective offline-first approach.</li></ol><p>By addressing these three core topics, readers will develop a comprehensive understanding of offline-first applications, Sqflite as a local database solution, and the design principles behind our Arkitek DORS application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*ZgeT1tWkTBXF8SkhdV22Vw.png" /><figcaption>Online vs Offline First Diagram</figcaption></figure><p>Offline-First is an approach that ensures seamless functionality of software both offline and online. To achieve this, critical data needs to be stored on the client side, allowing the application to continue operating even without internet connectivity. This is accomplished by utilizing a local database to store data obtained from the original source, such as an API. When the internet connection is restored, the data is then sent to the backend in the background, ensuring synchronization between the local and remote databases.</p><p>Offline-first is primarily intended for mobile applications that frequently encounter unstable internet connections, such as in below-ground level areas or rural countryside villages. It is important to understand that offline-first does not solely mean no internet connection. Instead, it focuses on ensuring uninterrupted app functionality by using locally stored data until a stable internet connection is available for synchronization with the backend system.</p><h3>Packages:</h3><p><strong>Sqflite:</strong></p><p><a href="https://pub.dev/packages/sqflite">sqflite | Flutter package</a></p><p>Sqflite is a Flutter plugin for SQLite, a self-contained, high-reliability, embedded, SQL database engine. Supports iOS, Android and MacOS. Transaction and batch support. It’s very easy to use, especially if you are familiar with SQL. If you want to learn more about sqflite, check out <a href="https://medium.flutterdevs.com/sqflite-in-flutter-3419cb6c247">SQFlite In Flutter</a>, an awesome medium article by <a href="https://medium.com/@raksha_goswami?source=user_profile-------------------------------------"><strong>Raksha Goswami</strong></a><strong>.</strong></p><p><strong>Connection Status:</strong></p><p><a href="https://pub.dev/packages/connectivity_plus">connectivity_plus | Flutter package</a></p><p>Connection status refers our devices network status, whether it is online(connected to internet) or offline. <a href="https://pub.dev/packages/connectivity_plus"><strong>connectivity_plus</strong></a> plugin allows Flutter apps to discover network connectivity and configure themselves accordingly. It can distinguish between cellular vs Wi-Fi connections. If you like to learn more, check out this awesome medium article, <a href="https://medium.com/flutter-community/manage-connectivity-in-your-flutter-app-325bcb04ea7e">Manage Connectivity In Your Flutter App</a> by <a href="https://medium.com/@gaspard.merten?source=user_profile-------------------------------------"><strong>Gaspard Merten</strong></a></p><h4>Let’s begin:</h4><p><strong>1- Packages:</strong> Add these packages to your pubspec.yaml and save</p><ul><li><a href="https://pub.dev/packages/sqflite">sqflite</a></li><li><a href="https://pub.dev/packages/connectivity_plus"><strong>connectivity_plus</strong></a></li></ul><p><strong>2- Connection Monitoring:</strong> We are going to create a file named <a href="https://gist.github.com/turtlepile/598f6c95c92bb7c0c618b65bbd3f5027">connectionStatus.dart</a>, which will include our functions for connection status controls. We are going to use this to check our connection and log our actions. It should look like <a href="https://gist.github.com/turtlepile/598f6c95c92bb7c0c618b65bbd3f5027">this</a>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9e54c216e3a614941ffacaa472c846a/href">https://medium.com/media/b9e54c216e3a614941ffacaa472c846a/href</a></iframe><p><strong>Important Note:</strong> The “<strong>GetNotificationCount</strong>” endpoint is a vital component of our REST API. You might question why we didn’t opt for a public API or simply ping a service like Google. The reason is our intention extends beyond verifying a <strong>general internet connection</strong>. We specifically need to ensure that our application can establish <strong>communication with our dedicated server</strong>. This ensures reliable access to the required data and functionality, enabling a seamless user experience that aligns with our specific needs.</p><p><strong>3- Initialize connectionStatus: </strong>To initialize connection checker, navigate to the main.dart file and include the following line of code:</p><pre>void main() async {<br>  connectionStatus.initialize();</pre><p>When you call the initialize method, it sets up a listener to track changes in your network connection, such as switching from mobile data to Wi-Fi or going offline. This listener triggers the <strong>_connectionChange </strong>event whenever a connection change occurs. This enables your application to promptly respond and adapt to these changes, ensuring smooth operation and a seamless user experience.</p><p><strong>Important Note:</strong> To address the issue of setting variables correctly when the device starts without internet connectivity, we made the decision to call the “<strong>checkConnection</strong>()” method during the initialization process. This ensures proper variable setup even if the device lacks internet access initially, as the <strong>connectionChange </strong>event may not trigger in such cases. However, it’s important to note that when the device is online, this approach results in two requests to the server during the initialization phase. While this incurs an additional cost, we considered it worthwhile to ensure accurate variable assignment in offline scenarios.</p><pre>//Hook into flutter_connectivity&#39;s Stream to listen for changes<br>  //And check the connection status out of the gate<br>  void initialize() {<br>    _connectivity.onConnectivityChanged.listen(_connectionChange);<br>    checkConnection();<br>  }</pre><p>At the initiation of our application, the line _connectivity.onConnectivityChanged.listen(_connectionChange) is invoked, setting up a listener that detects changes in connectivity.</p><pre>void _connectionChange(ConnectivityResult result) async {<br>    print(&quot;_connectivity connection changed: $result&quot;);<br>    //if ConnectivityResult.none, there&#39;s no need to &quot;check&quot;<br>    if (result != ConnectivityResult.none) {<br>      await checkConnection();<br>    } else {<br>      hasConnection = false;<br>    }<br>  }</pre><p>The <strong>checkConnection </strong>function plays a crucial role in overseeing and managing the internet connectivity for our application.</p><p><strong>4- Creating Database and Tables: W</strong>e created a class called <a href="https://gist.github.com/turtlepile/d25406f4835e030f22a36fa00e976de5">dbhelper</a>. This class serves as a centralized hub for all database-related operations, such as creating the database and performing <strong>CRUD</strong> operations (Create, Read, Update, Delete). By organizing these functions within the dbhelperclass, we can easily manage and manipulate the database, ensuring efficient data management in our application.</p><p><em>The following functions serve as illustrative examples that can be adjusted to suit your specific code implementation:</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3611c6a497897fe2eaff8e1f70c75ef7/href">https://medium.com/media/3611c6a497897fe2eaff8e1f70c75ef7/href</a></iframe><p><strong>5- Store Data Locally and Try Sending Periodically:</strong> In our application, when a user performs an operation, we take a different approach by not immediately sending the data to the server via an API. Instead, we utilize the insert function in our dbhelper to write the data into our local table. To handle the synchronization with the server, we have a function called “<strong>synchronizePendingData</strong>” which is triggered periodically by a timer. This timer is initialized in the main.dart file, ensuring that any pending data transfers are processed and synchronized with the server at appropriate intervals. (we set it to 3)</p><pre>Future&lt;bool&gt; synchronizePendingData() async {<br>    bool isTimerRunning = false;<br>    print(&quot;synchronizePendingData&quot;);<br>    timer = Timer.periodic(Duration(minutes: 3), (timer) async {<br>      pendingData = await checkPendingData();<br>      isTimerRunning = true;<br>      if (pendingData &amp;&amp; connectionStatus.hasConnection) {<br>        {<br>          sendTransferObjectToAPI();<br>        }<br>      }<br>    });<br>    return isTimerRunning;<br>  }</pre><p><strong>6- checkPendingData: </strong>This function performs a select query on our tables and filters unsent data using the “ISSENT” column. If the count of unsent data is greater than zero, function returns true and our flow proceeds to the <strong>sendTransferObjectToAPI </strong>function.</p><p><em>The following functions serve as illustrative examples that can be adjusted to suit your specific code implementation:</em></p><pre>Future&lt;bool&gt; checkPendingData() async {<br>    var listLocation =<br>        await dbHelper.getNotSentFromTable(&#39;locationServiceTable&#39;);<br>    if (listLocation.length &gt; 10) {<br>      return true;<br>    }<br>    var list2 = await dbHelper.getNotSentFromTable(&#39;table2&#39;);<br>    if (list2.length &gt; 0) {<br>      return true;<br>    }<br>    var list3= await dbHelper.getNotSentFromTable(&#39;table3&#39;);<br>    if (list3.length &gt; 0) {<br>      return true;<br>    }<br>  }</pre><p>Within the <strong>sendTransferObjectToAPI </strong>function, the initial step involves checking for an active internet connection. <strong>If the device is online</strong>, the function proceeds to send the data to the server via the REST API. After sending the data, we locally update entity.ISSENT columnt to = 1, to prevent sending more than once.</p><p><em>The following functions serve as illustrative examples that can be adjusted to suit your specific code implementation:</em></p><pre>Future&lt;void&gt; sendTransferObjectToAPI() async {<br>    if (await connectionStatus.checkConnection()) {<br>        await postLocation();<br>        await postTable1();<br>        await postTable2();<br>          .<br>          .<br>          . <br>        await cacheRefresh();<br>      <br>    }<br>  }</pre><p>Following the successful data transmission, the <strong>cacheRefresh </strong>function is executed!</p><p>The <strong>cacheRefresh </strong>function performs a series of operations to update the local cache. Firstly, it truncates the relevant tables in the local database, removing existing data. Then, it retrieves fresh data from the server, typically related to items such as an awaiting task list or customer list, and inserts this new data into the local database. The purpose of this process is to ensure an up-to-date and refreshed dataset, enhancing the application’s functionality and responsiveness, particularly when an active internet connection is available.</p><p><em>The following functions serve as illustrative examples that can be adjusted to suit your specific code implementation:</em></p><pre>Future&lt;void&gt; cacheRefresh() async {<br>    if (await connectionStatus.checkConnection()) {<br>      await generalService<br>          .getAll(url: &quot;GetMyActiveWorks&quot;)<br>          .then((response) async {<br>        if (!response.toString().contains(&quot;ArkitekApiErrorOccured&quot;)) {<br>          await dbHelper.truncateWorksTable().then((v) async {<br>            await dbHelper.insertWorksTable(response);<br>          });<br>        }<br>      });</pre><pre>      await generalService<br>          .getAll(url: &#39;GetMyDailyClosedWorks&#39;)<br>          .then((response) async {<br>        if (!response.toString().contains(&quot;ArkitekApiErrorOccured&quot;)) {<br>          await dbHelper.insertWorksTable(response);<br>        }<br>      });<br>          .<br>          .<br>          .<br>          .<br>    }</pre><p>To successfully implement an offline-first approach in Flutter, follow these key steps:</p><ol><li><strong>Local database:</strong> Choose a suitable local database solution such as Sqflite, as it supports iOS and Android and allows you to create a relational database. This database will serve as the storage for your application’s data.</li><li><strong>Connection monitoring:</strong> Set up a connection monitoring mechanism using a stream. By listening to the connection status, you can determine whether your application is online or offline. This enables you to adapt your application’s behavior based on the network availability.</li><li><strong>Synchronization timer:</strong> Implement a timer that triggers your synchronization function at regular intervals. When the device is online, the synchronization function sends the locally stored data to the server via an API, ensuring that the data stays up to date.</li><li><strong>Cache clearing:</strong> Include a cache clearing function to delete outdated or unnecessary data from the local database. This ensures that your application does not consume excessive storage space. Additionally, the cache clearing function retrieves updated data from the server, ensuring that your application stays synchronized with the latest information.</li></ol><p>By following these steps, you can build a robust offline-first Flutter application that handles data storage, synchronization, and cache management while providing a smooth user experience.</p><p>Thank you for reading my article! If you have any questions, you can ask in the comment sections and I will try to clarify.</p><p>Have a great day!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ace2843d36d8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codebrew/offline-first-approach-with-flutter-ace2843d36d8">Offline First Approach With Flutter</a> was originally published in <a href="https://medium.com/codebrew">CodeBrew</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Android App Distribution with Visual Studio AppCenter]]></title>
            <link>https://medium.com/codebrew/flutter-android-app-distribution-with-visual-studio-appcenter-1b94f3ee8fd1?source=rss-32318402cb34------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b94f3ee8fd1</guid>
            <dc:creator><![CDATA[Tugba Çekirge]]></dc:creator>
            <pubDate>Thu, 11 Aug 2022 11:25:18 GMT</pubDate>
            <atom:updated>2024-04-27T19:02:59.507Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone,</p><p>My name is <a href="https://www.linkedin.com/in/tugbacekirge/">Tugba</a>; I am acting as a software development team lead at<a href="https://www.linkedin.com/company/arkitek-net/"> Arkitek R&amp;D</a>. In Arkitek, we are building mobile, desktop, and web applications using technologies such as <a href="https://vuejs.org/"><strong>VueJS</strong></a>, <a href="https://flutter.dev/"><strong>Flutter</strong></a><strong>, </strong>and <a href="https://docs.microsoft.com/en-us/dotnet/csharp/"><strong>C#</strong></a>. Since 2021, we have been developing our web/mobile projects in Flutter, and needless to say, Flutter is amazing. After two years, we hived many know-how and some workarounds and I will try to share whenever I find a chance.</p><p>If you like my content, you can <a href="http://buymeacoffee.com/turtlepile">buy me a p</a>izza!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jIsb39vI4ms1nXFo.png" /></figure><p>Distributing our app to <a href="https://www.apple.com/app-store/">app store</a> or <a href="https://play.google.com/">play store</a> seems the best way to reach a lot of users but in some cases, we might need to follow a different path. Let’s say, we create a solution for a specific customer and we don’t want to use an enterprise solution. (Why? Because they are a little expensive and not very easy to manage in some cases) or we just want to distribute our application more frequently and more freely.</p><p>In Arkitek, we are using <a href="https://appcenter.ms/">Visual Studio AppCenter</a> for such cases. There are some benefits of using <a href="https://appcenter.ms/">Visual Studio AppCenter</a>. It lets you automate and manage the lifecycle of your iOS, Android, Windows, and macOS apps. You can distribute your apps more frequently. You can connect your repo(I didn’t) and automate your builds, test on real devices in the cloud, distribute apps to beta testers, and monitor real-world usage with crash and analytics data.</p><p>In this article, I will try to explain step by step, how to distribute a Flutter application via <a href="https://appcenter.ms/">Visual Studio AppCenter</a> and highlight some key points.</p><p><strong>Don’t forget to create your distribution certificates jks file for Android APK signing.</strong></p><p><strong>1- Hello AppCenter</strong></p><p>First of all, you need to register to AppCenter and create your organization. It is very easy and you can just follow the steps. After registering your organization, create your project application. In this article, I will just cover android, but I will publish the IOS version too, soon.</p><p><strong>2- Android Application</strong></p><p>Create your application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*2PsH4hVcAHHLlSs8fZTxZA.png" /></figure><p><strong>3- Activating on Flutter</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*mLM5tCzsnCeqvejx.jpg" /></figure><p>In Flutter, when we want to use a package, we just go ahead and add it into our pubspec.yaml and import it into our dart file(main mostly) and use it. Unfortunately with VS-AppCenter, importing packages to main.dart is no way. In official tutorials, they are mainly leading you to import packages into <strong>main.dart</strong> and init AppCenter before runApp.</p><p>I tried it and faced this beautiful error:</p><blockquote>Error: Cannot run with sound null safety, because the following dependencies don’t support null safety:</blockquote><blockquote>package:appcenter</blockquote><blockquote>package:appcenter_analytics</blockquote><blockquote>package:appcenter_crashes</blockquote><blockquote>For solutions, see <a href="https://dart.dev/go/unsound-null-safety">https://dart.dev/go/unsound-null-safety</a></blockquote><blockquote>FAILURE: Build failed with an exception.</blockquote><p>My problem was the packages I imported. They were not properly working with null-safety. (In another tutorial, there was a suggestion to go with f<strong>lutter run — no-sound-null-safety</strong> but it was a big NO for me, also even if I did, IOS would fire a lot of errors into my face..)</p><p>So, this is how I managed it:</p><p><strong>3.1 </strong>Go to your <strong>MainActivity</strong>.java (if you don’t have one, just create a file name MainActivity.java). It should be under this path:</p><p><strong><em>android\app\src\main\java\com\arkitek\flutter\project_name\MainActivity.java</em></strong></p><p>Should be like <a href="https://gist.github.com/turtlepile/1f3c9d0da0e9ccf43fe73ffc66f20cb4">this:</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/413d4522908416c89c4a90dc6c2c3936/href">https://medium.com/media/413d4522908416c89c4a90dc6c2c3936/href</a></iframe><p>important -&gt; You can see here that on line 14, I added a track event for my application start, so whenever a user starts the app, it will show under my Events section. You can see all of your events under</p><p><strong><em>AppCenter -&gt; ProjectName -&gt; Analytics -&gt; Events</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z2oaUcHygjH4LZ9GhFFAGw.png" /><figcaption>Events</figcaption></figure><p><strong>3.2</strong> Go to your <strong>AndroidManifest.xml.</strong></p><p>It should be under this path: <strong><em>android\app\src\main\AndroidManifest.xml</em></strong></p><p>And add these 3 permissions:</p><p><em>&lt;uses-permission android:name=”android.permission.</em><strong><em>INTERNET</em></strong><em>”/&gt;</em></p><p><em>&lt;uses-permission android:name=”android.permission.</em><strong><em>REQUEST_INSTALL_PACKAGES</em></strong><em>”/&gt;</em></p><p><em>&lt;uses-permission android:name=”android.permission.</em><strong><em>DOWNLOAD_WITHOUT_NOTIFICATION</em></strong><em>”/&gt;</em></p><p><strong>3.3</strong> Go to <strong>app/build.grade.</strong></p><p>It should be under this path: <strong><em>android\app\build.gradle</em></strong></p><p>In the dependencies section, add the following lines:</p><p><em>dependencies {</em></p><p><em>def appCenterSdkVersion = ‘4.1.0’</em></p><p><em>implementation “com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}”</em></p><p><em>implementation “com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}”</em></p><p><em>implementation “com.microsoft.appcenter:appcenter-distribute:${appCenterSdkVersion}”</em></p><p><em>}</em></p><p>Your build.gradle should look like this: (from lines 72 to 82)</p><figure><img alt="Build.gradle" src="https://cdn-images-1.medium.com/max/968/1*bLUmPdXSO4vRJgY-bOcSwg.png" /></figure><p><strong>4- Version Control</strong></p><p>The configuration part is done. Now, let&#39;s jump to distribution. Before we build our <strong>APK</strong>, we need to change our <strong>APK </strong>versions. By doing this, we are letting AppCenter know that we are releasing an update. Let&#39;s assume we are releasing the 1.0.20 version of our application.</p><p>We are going to modify 3 files:</p><ul><li>app\build.gradle</li><li>pubspec.yaml</li><li>AndroidManifest.xml</li></ul><p><strong>4.1 android\app\build.gradle</strong></p><p>In your build.gradle, go ahead and find “<strong><em>versionCode” </em></strong><em>and </em><strong><em>“versionName” </em></strong>and change like in the example below:</p><p><em>..<br>Android {</em></p><p><em>defaultConfig {<br>applicationId “********”<br>minSdkVersion 21<br>targetSdkVersion 30<br></em><strong><em>versionCode 20</em></strong><em><br></em><strong><em>versionName </em></strong><em>“1.0.20”<br>}</em></p><p><strong>4.2 pubspec.yaml</strong></p><p>Go to your pubspec.yaml and find the “<strong>version” </strong>key and change it to:</p><p><strong>version</strong>: 1.0.20+1</p><p><strong>4.3 AndroidManifest.xml</strong></p><p>Go to your AndroidManifest.xml file under “android\app\src\main\AndroidManifest.xml” and find <strong>android:versionCode and android:versionName </strong>keys and modify them like in the example below:</p><p><em>&lt;manifest xmlns:android=”http://schemas.android.com/apk/res/android&quot;<br></em><strong><em>android:versionCode</em></strong><em>=”20&quot;<br></em><strong><em>android:versionName</em></strong><em>=”1.0.20&quot;<br>package=”com.arkitek.flutter.arkitek_app_internal”&gt;</em></p><p><strong>5 Distribution</strong></p><p>If you are at this step, congrats, just a few more minutes and your distribution link will be ready for your users!</p><p><strong>5.1 Build APK</strong></p><p>Open your terminal and build your APK by these commands :</p><ul><li>flutter clean</li><li>flutter pubget</li><li>flutter build apk — split-per-abi</li></ul><p>If it’s successful you should just see a message like this:</p><p><strong>Built build\app\outputs\flutter-apk\app-armeabi-v7a-release.apk (11.6MB).</strong></p><p>Go ahead and open this folder and see your <strong>app-armeabi-v7a-release.apk</strong></p><p>The file should be under this path: <strong><em>build\app\outputs\flutter-apk\app-armeabi-v7a-release.apk</em></strong></p><p><strong>5.2 Upload to A</strong><a href="https://appcenter.ms/apps"><strong>ppCenter</strong></a></p><p>Go to AppCenter -&gt; Your Organization -&gt; Your Application</p><ul><li>In the left panel, click on the Distribution section. It will open a screen where you will see &amp; manage all of your releases. You can disable/delete it and see how many times downloaded it.</li><li>Click the N<strong>ew Release</strong> button, and it will open a panel from the right side of your screen.</li><li>Drag &amp; drop (or click upload) the APK file, you just created. (Be careful to choose the correct file -&gt; Built build\app\outputs\flutter-apk\app-armeabi-v7a-release.apk)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*QhMRuJhVOjZGnO4Qu5buoQ.png" /></figure><ul><li>Click Next and select your distribution group.</li><li>This is important. If you choose “Public” it will generate a link that can be reached publicly. You can just send the link to your users and they can download &amp; install the app. I use this option for project-specific applications.</li><li>If you would like to go for a closed test group, you can create a group and add users to it and select the group for your destination.</li><li>I choose <strong>mandatory </strong>update and did <strong>not choose the </strong>“don&#39;t notify users” option. I want to see the “you have a new update” pop-up.</li></ul><p>And save. That’s it. This is how we distribute our Android app via AppCenter.</p><p>You can just send your testers your installation link. If you like to test distributing a new version scenario:</p><ul><li>Install the app to a real device, via the AppCenter installation link</li><li>go to step 5.1 and increase the version number</li><li>build your apk</li><li>distribute your new APK</li><li>and open your app, on your device.</li></ul><p>You should see a pop-up screen that notifies you about the new version and release notes (if you added)</p><p>In my opinion, VS AppCenter is a fast and reliable solution. After a while, the analytics dashboard will look fancier with lots of data, your adaption rate, device models, daily session durations, etc.</p><p>Thank you for reading my article! If you have any questions, you can ask in the comment sections and I will try to clarify.</p><p>Have a great day!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b94f3ee8fd1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codebrew/flutter-android-app-distribution-with-visual-studio-appcenter-1b94f3ee8fd1">Flutter Android App Distribution with Visual Studio AppCenter</a> was originally published in <a href="https://medium.com/codebrew">CodeBrew</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firebase Cloud Messaging with Flutter]]></title>
            <link>https://medium.com/codebrew/firebase-cloud-messaging-with-flutter-b103435a3b2e?source=rss-32318402cb34------2</link>
            <guid isPermaLink="false">https://medium.com/p/b103435a3b2e</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[firebasecloudmessaging]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <dc:creator><![CDATA[Tugba Çekirge]]></dc:creator>
            <pubDate>Thu, 28 Jul 2022 22:35:38 GMT</pubDate>
            <atom:updated>2022-08-11T13:04:08.362Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello,</p><p>My name is <a href="https://www.linkedin.com/in/tugbacekirge/">Tugba</a>; I am acting as a software development team lead at<a href="https://www.linkedin.com/company/arkitek-net/"> Arkitek R&amp;D</a>. In Arkitek, we are building mobile, desktop, and web applications using technologies such as <a href="https://vuejs.org/"><strong>VueJS</strong></a>, <a href="https://flutter.dev/"><strong>Flutter</strong></a><strong>, </strong>and <a href="https://docs.microsoft.com/en-us/dotnet/csharp/"><strong>C#</strong></a>. Since 2021, We have been developing our web/mobile projects in Flutter, and needless to say, Flutter is amazing. After two years, we hived many know-how and some workarounds and I will try to share whenever I find a chance.</p><p>If you like my content, you can <a href="http://buymeacoffee.com/turtlepile">buy me a p</a>izza!</p><p>In this article, I will try to explain our step-by-step guide to</p><h4>1- How to add FCM to your Flutter mobile application and manage subscriptions.</h4><h4>2- How to send messages to your application: Server-side</h4><p>Before I begin, I would like to mention and thank my junior, <a href="https://www.linkedin.com/in/ekinberkb/">Ekin Berk Bozkurt</a> for the amazing work and the great effort that he puts in our flutter projects. We love you, Ekin ❤</p><p>And one more thing! This is my first medium post so excuse me if I make mistakes.</p><p>Ok, let’s begin.. :)</p><p>Our flutter project is running on multiple platforms: IOS, Android, and Web. In this article, I will just walk through <strong>FCM </strong>to <strong>IOS </strong>and <strong>Android </strong>platforms.</p><p>First, we are going to create and register our apps in FCM. I’m going to try my best to not leave holes in the process but if I do, please excuse me.</p><ol><li>Go to <a href="https://console.firebase.google.com/">https://console.firebase.google.com/</a> and create your project if you haven&#39;t yet.</li></ol><p>2. Select <strong>IOS</strong> App (If you are not building an IOS app, you can skip 2 and jump to 3)<br><br><strong>There are 5 steps to follow for registering an IOS app:</strong><br> 2.1 — Register your app. FCM asks for some information (Apple ID etc) that you can easily get from <a href="https://appstoreconnect.apple.com/apps">AppStoreConnect</a><br> 2.2 — After you complete the form, you will get a <strong>GoogleService-Info.plist</strong> file. Download the file -&gt; Open <strong>XCode</strong> -&gt; Go to Runner-&gt; Add this file in the same folder where your <strong>Info.plist</strong> is. <em>(Important: You need to perform this action with XCode, otherwise it doesn’t work. Do not use VS-Code or file explorer etc..)</em></p><p>2.3 — Adding Firebase SDK: <em>** this action occurred an error and took it back after **</em><br>Open <strong>XCode </strong>again, see the “Add Packages” section. Type <a href="https://github.com/firebase/firebase-ios-sdk">https://github.com/firebase/firebase-ios-sdk</a> and enter. It will show libraries you can add, I will only choose analytics and messaging.</p><p>2.4 — Open your <strong>AppDelegate.m</strong> file from <strong>XCode </strong>and make these imports<br> <a href="http://twitter.com/import"><em>@import</em></a><em> FirebaseCore;<br> </em><a href="http://twitter.com/import"><em>@import</em></a><em> FirebaseMessaging;<br> </em><a href="http://twitter.com/import"><em>@import</em></a><em> FirebaseAnalytics;</em></p><p><em>and these lines: <br>(BOOL)application:(UIApplication *)application<br> didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {</em></p><p><em>if (</em><a href="http://twitter.com/available"><em>@available</em></a><em>(iOS 10.0, *)) {<br> [UNUserNotificationCenter currentNotificationCenter].delegate = (id&lt;UNUserNotificationCenterDelegate&gt;) self;<br> } <br></em><strong><em> — →&gt;&gt;&gt; [FIRApp configure]; &lt;&lt;&lt;&lt;← — — — — -<br></em></strong><em> [GeneratedPluginRegistrant registerWithRegistry:self];<br> // Override point for customization after application launch.<br> return [super application:application didFinishLaunchingWithOptions:launchOptions];<br> }</em></p><p><a href="http://twitter.com/end"><em>@end</em></a><br> <br> 2.5 — Go back to the firebase console, select your IOS project and click the “Settings” icon and go to the <strong>Project Settings</strong> page. Go to the “<strong>Console Messaging</strong>” tab. We need to register our APNs Authentication Key(Apple Push Notifications), which you can get by following the steps below:</p><p>go to -&gt; <a href="https://developer.apple.com/account/resources/certificates/list">https://developer.apple.com/account/resources/certificates/list</a><br> 2.5.1 — Add New Key<br> 2.5.2 — Name your key as you like, I used something like <strong>MyAppNameAPNs</strong><br> 2.5.3 — Click and check the Apple Push Notifications service<br> 2.5.4 — continue -&gt; register<br> 2.5.5 — Download <br> 2.5.6 — Copy Name and KeyID (you will need this information)</p><p>Return to firebase console. Click APNs Authentication Key, upload the file at step 5, and enter KeyID and your TeamID <em>(apple developer account -&gt; membership)</em></p><p>Now let&#39;s add FCM to our Android Project: <em>( If you are not developing an Android project, skip 3 and jump to the 5th step)</em><br><br>3 — Go to the firebase console, and add an android project. <br> 3.1 — Enter your app information and continue.<br> 3.2 — Download <strong>google-service.json</strong><br> 3.3 — Open <strong>VSCode </strong>and add this file under the app folder.<br> 3.4 — Open <strong>app/build gradle</strong> and add implementation lines in dependencies and apply plugins <br><br> <em>dependencies {<br> implementation platform(‘com.google.firebase:firebase-bom:30.1.0’)<br> // Add the dependency for the Firebase SDK for Google Analytics<br> // When using the BoM, don’t specify versions in Firebase dependencies<br> implementation ‘com.google.firebase:firebase-analytics’<br> }<br> apply plugin: ‘com.google.gms.google-services’<br> apply plugin: ‘com.android.application’<br> </em><br> 3.4 — Open<strong> build.gradle</strong> and</p><p>3.4.1 — Add this line in the dependencies section:</p><ul><li><em>classpath ‘com.google.gms:google-services:4.3.10’ // Google Services plugin</em></li></ul><p>3.4.2 — Add google() to repositories in all projects and build script.</p><p>Your build gradle should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*1UTPKpNg_yInuTodPbFmQQ.png" /><figcaption>build.gradle</figcaption></figure><p>4 — for IOS -&gt; Open XCode -&gt; targets -&gt; select your project-&gt; sign in &amp; Capabilities <br> Click + (plus) button and select</p><ul><li>push notifications -&gt; check</li><li>background modes -&gt; check these two:<br> — background fetch<br> — remote notifications</li></ul><p><em>Follow this document if you need a more detailed explanation <br></em><a href="https://firebase.flutter.dev/docs/overview"><em>https://firebase.flutter.dev/docs/overview</em></a><em> </em><br>5 —Open VS Code and go to your terminal and enter these in order:</p><p>5.1 — flutter pub add <a href="https://pub.dev/packages/firebase_core"><strong>firebase_core</strong></a></p><p>5.2 — dart pub global activate flutterfire_cli</p><p>5.3 — export PATH=”$PATH”:”$HOME/.pub-cache/bin”</p><p><em>if you get this error -&gt; Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path.<br> You can fix that by adding this to your shell’s config file (.bashrc, .bash_profile, etc.)</em></p><p>5.4 — firebase login</p><p><em>will ask for credentials, you need to enter the one you are using in the firebase console.</em></p><p>5.5 — flutterfire configure</p><p>Select your project.</p><p>It will create <strong>firebase_options</strong>.dart file.</p><p>6- We are managing our FCM functions in a single dart file so we can access it properly. Create a file and name <strong>FCMFunctions</strong>.dart</p><p>Our FCMFunctions.dart is something like <a href="https://gist.github.com/turtlepile/3eddc47e5a0a79ef19c4a263719b2a4a">this</a>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2296776c1d803d365501b9046bfb3e48/href">https://medium.com/media/2296776c1d803d365501b9046bfb3e48/href</a></iframe><p>7 — Open main.dart</p><p>import ‘package:arkitek_app_internal/data/FCMFunctions.dart’;</p><p>and call your functions in runApp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*tq6eB2blNwJTMIBMPsk3lg.png" /><figcaption>main.dart</figcaption></figure><p>Note: At line 9, we are subscribing to a channel that we named <strong>“All”</strong>. We are using this to send notifications to everyone. Also after login, we are calling</p><p><em>await fcmFunctions.subscripeToTopics(“acc” + response[0][‘AccID’].toString());</em></p><p>So every user is subscribed to two channels by default: All and to its own account channel. We decided to follow this way because managing user-based notifications were very complicated and challenging.</p><p><em>// how to manage user base notifications in short -&gt; you need to get an FCM token, store it in DB, and archive every token if it’s older than two months because there’s no method to check if the token is valid. So yeah, we didn’t want to go that way.</em></p><p>7 —Go to <strong>pubspec.yaml</strong> and add<br> firebase_messaging: ^11.4.2<br> firebase_analytics: ^9.1.9</p><p><em>note: I removed firebase SDK from dependencies because I got an error.</em></p><p>Don’t forget to save (pub get)</p><p><strong>Freebie:</strong></p><p>We were using <strong>image_picker </strong>in our project and got this error whilst we were implementing FCM. If you get this error, it means your gradle is outdated and you need to update: <br><em> Execution failed for task ‘:app:lintVitalRelease’.<br> &gt; Could not resolve all artifacts for configuration</em> ‘:image_picker_android:debugUnitTestRuntimeClasspath’.</p><p><strong>how to fix:</strong><br> 1 -&gt; pubspec.yaml -&gt; image_picker: ^0.8.5+3<br> 2 -&gt; gradle-wrappler.properties <br> distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip<br> 3 -&gt; build.gradle -&gt;&gt; dependencies<br> classpath ‘com.android.tools.build:gradle:7.1.2’</p><p>So, the client-side is pretty much like the above. Let’s dive into the server side and I will try to explain, how we send our notifications.</p><p>We are using C# in our backend projects. If you are familiar with it, this will be pretty easy to follow.</p><p>— — — — — — — — — — — — — — — — <br>SERVER-SIDE<br> — — — — — — — — — — — — — — — — <br>The document I followed: <a href="https://firebase.flutter.dev/docs/messaging/server-integration">https://firebase.flutter.dev/docs/messaging/server-integration</a></p><p>1 — First, we need to install <strong>FirebaseAdmin </strong>so we go to <strong>NuGet </strong>and install the package</p><p><em>Install-Package FirebaseAdmin -Version 2.3.0</em><br>2 — After installing FA, open firebase console -&gt; go to <strong>Project Settings</strong> -&gt; <strong>Cloud Messaging</strong> -&gt; <strong>Manage Service Accounts</strong> -&gt; select account -&gt; KEYS -&gt; add key and <br>download the JSON file. ** we will use this file to get token from google **<br>3 — Add this file to your solution because we are going to read it for our credentials. <em>(there are other options for credentials, you can look it up if you are curious) (Important: do not share that file publicly)</em></p><p>4 — We need a class for our notification. Our MessageMain class is something like <a href="https://gist.github.com/turtlepile/79e3e894de741bfe243d559169d441be">this</a>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89d4f698aa7561928a5625b69debda90/href">https://medium.com/media/89d4f698aa7561928a5625b69debda90/href</a></iframe><p>5 — Sending notification!</p><p>5.1:</p><p>import these using:</p><p><strong>using Google.Apis.Auth.OAuth2;</strong></p><p><strong>using Newtonsoft.Json;</strong></p><p>Create a function</p><p>SendNotification(){</p><p>…….</p><p>MessageMain <strong>messageMain </strong>= new MessageMain();</p><p>Message message = new Message();</p><p>Notification notification = new Notification();</p><p>AndroidConfig android = new AndroidConfig();</p><p>android.Priority = Priority.High; // this is important. It allows your notification to pop even when the app is on and running (for Android)</p><p>message.Android = android;</p><p>notification.title = “New task: “ + dsWork.WO_WORKS[0].DESCRIPTION;</p><p>notification.body = dsWork.WO_WORKS[0].DESCRIPTIONDETAIL;</p><p>message.Notification = notification;</p><p><strong>message.topic = “acc” + AA_ACCOUNTS[0].ID; // this is important. It’s the user’s subscribed channels for its own account.</strong></p><p>messageMain.message = message;</p><p>var accessToken = await <strong>GetAccessToken</strong>().ConfigureAwait(false);</p><p>var url = “https://fcm.googleapis.com/v1/projects/{YOUR-PROJECT-NAME}/messages:send&quot;;</p><p><strong>HttpClient </strong>client = new HttpClient();</p><p>client.BaseAddress = new Uri(url);</p><p>client.DefaultRequestHeaders.Accept.Clear();</p><p>client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(“application/json”));</p><p>client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(“Bearer”, accessToken);</p><p>string json = <strong>JsonConvert</strong>.SerializeObject(<strong>messageMain</strong>);</p><p>var content = new StringContent(json, Encoding.UTF8, “application/json”);</p><p>var result = await client.PostAsync(url, content);</p><p>FOR <strong>GetAccessToken -&gt;&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1S4iiDuHLWtlfyufiYBG7Q.png" /><figcaption>GetAccessToken function</figcaption></figure><p>To SumUp → We created a method named, “<strong>SendNotification</strong>” in our case, it gets task details and user info. We initialize our MessageMain class and other child classes and set properties accordingly. After that, we called <strong>GetAccessToken </strong>and get our token from google to send our notification and post it via HttpClient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*yavWxo7TQ5EbBzYT" /><figcaption>❤</figcaption></figure><p>And this is it! This is how we implemented FCM to our IOS and Android applications. I tried to be straightforward as much as I could and mentioned some important anecdotes to save time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b103435a3b2e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codebrew/firebase-cloud-messaging-with-flutter-b103435a3b2e">Firebase Cloud Messaging with Flutter</a> was originally published in <a href="https://medium.com/codebrew">CodeBrew</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>