<?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 Vivien Mahé on Medium]]></title>
        <description><![CDATA[Stories by Vivien Mahé on Medium]]></description>
        <link>https://medium.com/@vivienmahe?source=rss-15ccf1319eb3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6XokMEEIQtRhnujCKyGhlw.png</url>
            <title>Stories by Vivien Mahé on Medium</title>
            <link>https://medium.com/@vivienmahe?source=rss-15ccf1319eb3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 15:20:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vivienmahe/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[What’s New in Alarmee 2.3.1: Smarter Notifications for Kotlin Multiplatform]]></title>
            <link>https://vivienmahe.medium.com/whats-new-in-alarmee-2-3-1-smarter-notifications-for-kotlin-multiplatform-b9d419fb4ab7?source=rss-15ccf1319eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9d419fb4ab7</guid>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[local-notifications]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[push-notification]]></category>
            <dc:creator><![CDATA[Vivien Mahé]]></dc:creator>
            <pubDate>Sun, 24 Aug 2025 08:59:36 GMT</pubDate>
            <atom:updated>2025-08-24T08:59:36.014Z</atom:updated>
            <content:encoded><![CDATA[<p>Back in June, I published <a href="https://vivienmahe.medium.com/alarmee-schedule-local-and-push-notifications-in-kmp-44ea47972ae7">my first article about Alarmee 2.0.0</a>.</p><p>That version was a big milestone introducing <strong>push notifications on iOS and Android</strong>, along with a revamped API.</p><p>Since then, <a href="https://github.com/Tweener/alarmee">Alarmee</a> has kept evolving. With version <strong>2.3.1</strong>, the library is now more modular, flexible, and production-ready than ever.</p><p>In this article, I will walk you through <strong>what’s new since 2.0.0</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jdErfneINXeNmkVVJY5KEA.png" /><figcaption>Alarmee notifications with images</figcaption></figure><h3>1. Local vs Push Notifications split</h3><p>Alarmee is now split into <strong>two separate dependencies</strong>:</p><pre>// For local notifications only (all targets)<br>implementation(&quot;io.github.tweener:alarmee:$version&quot;)<br><br>// For local + push notifications (Android &amp; iOS only)<br>implementation(&quot;io.github.tweener:alarmee-push:$version&quot;)</pre><p>This makes setup cleaner and avoids pulling in Firebase if you only need local notifications.</p><p>Initialization also depends on which dependency you use:</p><pre>// Local-only service<br>val service = rememberAlarmeeService()<br><br>// Local + Push service (Android &amp; iOS)<br>val mobileService = rememberAlarmeeMobileService()</pre><p>💡 <strong>On iOS</strong>: If you are only using local notifications, you can now <strong>skip Firebase</strong> entirely. No extra frameworks or background capabilities needed.</p><h3>2. Notifications with images</h3><p>Notifications are no longer limited to just text. You can attach <strong>images</strong> to both local and push notifications.</p><p>Here is an example of scheduling a notification with an image:</p><pre>localService.schedule(<br>    Alarmee(<br>        notificationTitle = &quot;🎉 Congrats!&quot;,<br>        notificationBody = &quot;Now with images!&quot;,<br>        imageUrl = &quot;https://rickandmortyapi.com/api/character/avatar/1.jpeg&quot;<br>    )<br>)</pre><p>This works on <strong>Android and iOS</strong>, making your notifications feel much richer.</p><h3>3. Firebase token callbacks</h3><p>Managing FCM tokens can be tricky. They can change when:</p><ul><li>A user reinstalls the app</li><li>Restores from backup</li><li>Or simply because Firebase refreshes them periodically</li></ul><p>Starting with <strong>2.3.0</strong>, Alarmee gives you an easy way to react to these changes:</p><pre>pushService.onNewToken { newToken -&gt;<br>    // Example: send token to your backend<br>    sendTokenToServer(newToken)<br>}</pre><p>For development, you can also force a refresh manually:</p><pre>pushService.forceTokenRefresh()</pre><p>No more guesswork. Your app always knows when tokens change.</p><h3>4. Push message callbacks</h3><p>You can now <strong>intercept incoming push payloads</strong>:</p><pre>pushService.onPushMessageReceived { payload -&gt;<br>    println(&quot;📩 Push message received: $payload&quot;)<br>    // Custom logic here: update UI, sync data, etc.<br>}</pre><p>This unlocks new scenarios:</p><ul><li>Update your in-app UI live</li><li>Trigger background syncs</li><li>Handle custom payload keys sent from your backend</li></ul><p>You can also register multiple callbacks, and all will be invoked when a push message arrives.</p><h3>Wrapping up</h3><p>Since 2.0.0, Alarmee has gone from <em>“local and push notifications support”</em> to a <strong>smarter, modular, and more powerful notification library</strong> for Kotlin Multiplatform.</p><p>Highlights:</p><ul><li>Cleaner dependency split (local vs push)</li><li>Rich notifications with images</li><li>Automatic Firebase token handling</li><li>Push payload callbacks for full control</li></ul><p>Alarmee is also used inside <a href="https://kmpship.app/"><strong>KMPShip</strong></a>, my Kotlin Multiplatform boilerplate that helps you <strong>quickly build and ship mobile apps</strong> for Android and iOS. If you are looking to kickstart a project with all the right pieces already in place, KMPShip might be a great fit.</p><p>If you are already using Alarmee, now is the perfect time to upgrade.</p><p>If you are new to it, check out the repository, give it a ⭐️, and start building better notification experiences in KMP:</p><p>👉 <a href="https://github.com/Tweener/alarmee">GitHub -&gt; Tweener/alarmee</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9d419fb4ab7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Alarmee: Schedule Local and Push Notifications in KMP]]></title>
            <link>https://vivienmahe.medium.com/alarmee-schedule-local-and-push-notifications-in-kmp-44ea47972ae7?source=rss-15ccf1319eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/44ea47972ae7</guid>
            <category><![CDATA[local-notifications]]></category>
            <category><![CDATA[push-notification]]></category>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <dc:creator><![CDATA[Vivien Mahé]]></dc:creator>
            <pubDate>Mon, 30 Jun 2025 08:37:53 GMT</pubDate>
            <atom:updated>2025-07-07T07:47:45.096Z</atom:updated>
            <content:encoded><![CDATA[<p>Notifications are essential in mobile apps, but handling <strong>local and push notifications in Kotlin Multiplatform (KMP)</strong> can quickly become a mess.</p><p>You need to deal with AlarmManager on Android, UNUserNotificationCenter on iOS, and glue it all together with shared logic.</p><p>So I built <strong>Alarmee</strong>, a Kotlin/Compose Multiplatform library to schedule local and push notifications using a single, shared API. It works on Android and iOS, and lets you create one-off or repeating alarms, send push notifications, and even show instant alerts.</p><p>Let’s dive in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*COC2z1NeZmZvfdPj" /><figcaption>Photo by <a href="https://unsplash.com/@jamie452?utm_source=medium&amp;utm_medium=referral">Jamie Street</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Features</h3><ul><li>Schedule one-time alarms</li><li>Set repeating alarms (hourly, daily, weekly, etc.)</li><li>Trigger instant notifications</li><li>Handle push notifications with FCM and APNs</li><li>Customize platform behaviors</li></ul><p>Alarmee works with Kotlin Multiplatform and Compose Multiplatform, so you can use it from your shared codebase.</p><h3>Installation</h3><p>To get started, add the Maven Central repository in your settings.gradle.kts:</p><pre>repositories {<br>    mavenCentral()<br>}</pre><p>If you’re using a version catalog (libs.versions.toml), declare the version and dependency like this:</p><pre>[versions]<br>alarmee = &quot;2.0.0&quot; # Or the latest version<br><br>[libraries]<br>alarmee = { group = &quot;io.github.tweener&quot;, name = &quot;alarmee&quot;, version.ref = &quot;alarmee&quot; }</pre><p>Then use it in your build.gradle.kts:</p><pre>dependencies {<br>    implementation(libs.alarmee)<br>}</pre><p>If you’re not using a catalog, add the dependency directly:</p><pre>val alarmee_version = &quot;2.0.0&quot;<br>implementation(&quot;io.github.tweener:alarmee:$alarmee_version&quot;)</pre><p>You can get the latest version from <a href="https://central.sonatype.com/artifact/io.github.tweener/alarmee">Maven Central</a>.</p><h3>Configuration (Android &amp; iOS)</h3><p>Before using Alarmee, you’ll need to provide platform-specific configuration. Here’s how to do it.</p><h4>Step 1: Declare an expect function in shared code</h4><p>In your commonMain sourceSet:</p><pre>expect fun createAlarmeePlatformConfiguration(): AlarmeePlatformConfiguration</pre><h4>Step 2: Android implementation</h4><p>In your androidMain, provide the actual configuration:</p><pre>actual fun createAlarmeePlatformConfiguration(): AlarmeePlatformConfiguration =<br>    AlarmeeAndroidPlatformConfiguration(<br>        notificationIconResId = R.drawable.ic_notification,<br>        notificationIconColor = Color.Red,<br>        notificationChannels = listOf(<br>            AlarmeeNotificationChannel(<br>                id = &quot;dailyNewsChannelId&quot;,<br>                name = &quot;Daily news notifications&quot;,<br>                importance = NotificationManager.IMPORTANCE_HIGH,<br>                soundFilename = &quot;notifications_sound&quot;<br>            ),<br>            AlarmeeNotificationChannel(<br>                id = &quot;breakingNewsChannelId&quot;,<br>                name = &quot;Breaking news notifications&quot;,<br>                importance = NotificationManager.IMPORTANCE_LOW<br>            )<br>        )<br>    )</pre><h4>Step 3: iOS implementation</h4><p>In your iosMain sourceSet, return the built-in platform config:</p><pre>actual fun createAlarmeePlatformConfiguration(): AlarmeePlatformConfiguration =<br>    AlarmeeIosPlatformConfiguration</pre><p>⚠️ Make sure to add Firebase to your Xcode project and enable Remote notifications and Push notifications in the capabilities.</p><h4>Step 4: Initialize Alarmee</h4><p>Then, in your commonMain sourceSet, Use the rememberAlarmeeService helper in a Composable function:</p><pre>val alarmService = rememberAlarmeeService(<br>    platformConfiguration = createAlarmeePlatformConfiguration()<br>)</pre><h3>Usage</h3><p>Before you do anything, make sure the app has notification permissions. You can use <a href="https://github.com/icerockdev/moko-permissions">moko-permissions</a> to handle this.</p><p>Once you have permissions and Alarmee is initialized, get the services like this:</p><h4>Access the local notification service</h4><p>To use local notifications, you need to get the LocalNotificationService like this:</p><pre>val localService = alarmService.local</pre><h4>Access the push notification service (only on Android &amp; iOS)</h4><p>To use push notifications, you need to get the PushNotificationService like this:</p><pre>val pushService = (alarmService as? MobileAlarmeeService)?.push</pre><p>Push notifications are only supported on Android and iOS, so be sure to call this from one of those targets.</p><h3>Schedule one-off alarm</h3><p>To schedule an alarm for a specific date and time, pass an Alarmee instance with scheduledDateTime:</p><pre>localService.schedule(<br>    alarmee = Alarmee(<br>        uuid = &quot;myAlarmId&quot;,<br>        scheduledDateTime = LocalDateTime(2025, 1, 12, 17, 0),<br>        notificationTitle = &quot;🎉 Congratulations!&quot;,<br>        notificationBody = &quot;This will appear at the specified time.&quot;,<br>        deepLinkUri = &quot;https://example.com&quot;,<br>        androidNotificationConfiguration = AndroidNotificationConfiguration(<br>            priority = AndroidNotificationPriority.HIGH,<br>            channelId = &quot;dailyNewsChannelId&quot;<br>        ),<br>        iosNotificationConfiguration = IosNotificationConfiguration()<br>    )<br>)</pre><h3>Schedule repeating alarm</h3><p>Alarmee supports both fixed and custom repeat intervals.</p><h4>Daily at 9:30 AM</h4><p>Here’s how to repeat an alarm every day at the same time:</p><pre>localService.schedule(<br>    alarmee = Alarmee(<br>        uuid = &quot;dailyAlarm&quot;,<br>        scheduledDateTime = LocalDateTime(2025, 1, 12, 9, 30),<br>        repeatInterval = RepeatInterval.Daily,<br>        notificationTitle = &quot;🔁 Daily reminder&quot;,<br>        notificationBody = &quot;This will trigger every day at 9:30.&quot;,<br>        androidNotificationConfiguration = AndroidNotificationConfiguration(<br>            priority = AndroidNotificationPriority.DEFAULT,<br>            channelId = &quot;dailyNewsChannelId&quot;<br>        ),<br>        iosNotificationConfiguration = IosNotificationConfiguration()<br>    )<br>)</pre><h4>Every 15 minutes (custom)</h4><p>If you want a custom duration (like every 15 minutes), use RepeatInterval.Custom:</p><pre>localService.schedule(<br>    alarmee = Alarmee(<br>        uuid = &quot;repeat15min&quot;,<br>        repeatInterval = RepeatInterval.Custom(duration = 15.minutes),<br>        notificationTitle = &quot;🔁 Every 15 min&quot;,<br>        notificationBody = &quot;This will trigger every 15 minutes.&quot;,<br>        androidNotificationConfiguration = AndroidNotificationConfiguration(<br>            priority = AndroidNotificationPriority.DEFAULT,<br>            channelId = &quot;otherChannelId&quot;<br>        ),<br>        iosNotificationConfiguration = IosNotificationConfiguration()<br>    )<br>)</pre><h3>Cancel an alarm</h3><p>To stop a scheduled alarm, just cancel it by its uuid:</p><pre>localService.cancel(uuid = &quot;myAlarmId&quot;)</pre><h3>Trigger an instant notification</h3><p>You can display a notification immediately using immediate(...):</p><pre>localService.immediate(<br>    alarmee = Alarmee(<br>        uuid = &quot;now&quot;,<br>        notificationTitle = &quot;🚀 Instant alert!&quot;,<br>        notificationBody = &quot;This shows right away.&quot;,<br>        androidNotificationConfiguration = AndroidNotificationConfiguration(<br>            priority = AndroidNotificationPriority.DEFAULT,<br>            channelId = &quot;immediateChannelId&quot;<br>        ),<br>        iosNotificationConfiguration = IosNotificationConfiguration()<br>    )<br>)</pre><h3>Customize notifications</h3><p>Alarmee lets you customize sound, icon, and badge behavior.</p><h4>Custom sound</h4><ul><li><strong>Android</strong>: Place the .ogg file in res/raw and reference it in soundFilename when defining your notification channel.</li><li><strong>iOS</strong>: Add the file to the main bundle and pass it in IosNotificationConfiguration.</li></ul><h4>Custom icon (Android only)</h4><p>Set a default icon in the platform config or override per alarm:</p><pre>notificationIconResId = R.drawable.ic_notification<br>notificationIconColor = Color.Yellow</pre><h4>Badge count (iOS only)</h4><p>Use this to update or clear the app icon badge:</p><pre>IosNotificationConfiguration(badge = 4) // Set badge<br>IosNotificationConfiguration(badge = 0) // Clear badge</pre><h3>Push Notifications</h3><p>On Android and iOS, Alarmee supports FCM and APNs through MobileAlarmeeService.push.</p><p>Alarmee will automatically display a notification when a push message with title and body is received. If an optional imageUrl is provided in the payload, it will be displayed within the notification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0GfTu9c7yFgJpoiXVcDnwQ.png" /><figcaption>Notifications with image, collapsed &amp; expanded, on iOS and Android</figcaption></figure><h3>Try Alarmee</h3><p>If you’re building a Kotlin Multiplatform app and dreading the mess of notifications, Alarmee is here to save you time and sanity.</p><p>It already powers real apps like <a href="https://www.bloomeo.app/">Bloomeo</a>, handling local and push notifications across Android and iOS using a single, shared API.</p><p>No hacks. No duplicated logic. Just clean, predictable code.</p><p>👉 <a href="https://github.com/Tweener/alarmee">GitHub Repo</a><br> ⭐ Give it a star if you find it useful<br> 📦 Add it to your project today<br> 🔔 Focus on features, not platform quirks</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44ea47972ae7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Android & iOS Apps Faster with KMPShip: A Kotlin Multiplatform Boilerplate for Indie Devs]]></title>
            <link>https://vivienmahe.medium.com/build-android-ios-apps-faster-with-kmpship-a-kotlin-multiplatform-boilerplate-for-indie-devs-9ff974d38a7e?source=rss-15ccf1319eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ff974d38a7e</guid>
            <category><![CDATA[compose-multiplatform]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[boilerplate]]></category>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[indiedev]]></category>
            <dc:creator><![CDATA[Vivien Mahé]]></dc:creator>
            <pubDate>Tue, 17 Jun 2025 16:02:05 GMT</pubDate>
            <atom:updated>2025-08-24T07:39:23.831Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the past few years, Kotlin Multiplatform has grown into a powerful solution for building cross-platform apps. But if you’ve ever tried starting a new KMP project, you know how much setup it takes: authentication flows, payments, CI/CD, store publishing, in-app reviews, remote config… The list goes on.</p><p>After repeating the same setup across multiple projects, I finally decided to build a boilerplate that solves all of this. It’s called <a href="https://www.kmpship.app/"><strong>KMPShip</strong></a>, and it’s now available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mQdBxocxZuKptx-JF8caHg.png" /></figure><h3>Why I Built KMPShip</h3><p>As an indie developer, my time is limited. Every time I kicked off a new project, I found myself spending days (sometimes weeks) integrating Firebase Auth, configuring payments with RevenueCat, setting up CI/CD for App Store and Google Play, or configuring push notifications.</p><p>Eventually, it hit me: <em>“Why not create a production-ready boilerplate I can reuse, and that other devs can use too?”</em> That’s how <strong>KMPShip</strong> was born.</p><p>I even used it to create my own app, <a href="https://bloomeo.app/"><strong>Bloomeo</strong></a>, which is live on the <a href="https://apps.apple.com/us/app/bloomeo-save-retire-early/id6657986537">App Store</a> and <a href="https://play.google.com/store/apps/details?id=com.tweener.bloomeo">Google Play</a>. Building with <strong>KMPShip</strong> allowed me to ship faster and focus on product features instead of wiring up the same integrations again.</p><h3>What’s Included in KMPShip?</h3><p><strong>KMPShip</strong> is a <strong>Kotlin Multiplatform + Compose Multiplatform boilerplate</strong> that helps you ship Android &amp; iOS apps faster. It’s perfect for solo devs, indie makers, and startups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4FIC0_JETnxmlQFUxd3y4g.png" /></figure><h3>🔐 Authentication</h3><ul><li>Google, Apple, and Email/Password</li><li>Built using <a href="https://github.com/Tweener/passage/">Passage</a>, my KMP library for authentication via Firebase Auth</li></ul><h3>💳 Payments</h3><ul><li>In-app purchases with <a href="https://www.revenuecat.com/">RevenueCat</a></li><li>Subscription support</li></ul><h3>🔔 Notifications</h3><ul><li>Local and push notifications</li><li>Powered by <a href="https://github.com/Tweener/alarmee">Alarmee</a>, my KMP library for alarms and scheduling</li></ul><h3>📝 In-App Reviews</h3><ul><li>Trigger store-compliant reviews with a few lines of code</li></ul><h3>⚙️ Remote Config</h3><ul><li>Firebase Remote Config support to dynamically tweak your app behavior (Feature Flags &amp; App Configuration Parameters)</li></ul><h3>🚀 CI/CD Setup</h3><ul><li>Preconfigured GitHub Actions to publish your app to the App Store via <a href="https://fastlane.tools/">Fastlane</a> and Google Play with a single release tag</li></ul><h3>Built on Clean Architecture</h3><p><strong>KMPShip</strong> is designed with Clean Architecture principles in mind. The shared module is organized into well-separated layers for data, domain, and presentation, making it easier to scale and maintain your codebase over time.</p><h4>Additional Highlights</h4><p><strong>KMPShip</strong> also comes with:</p><ul><li>Dependency injection using Koin</li><li>Networking setup with Ktor</li><li>Image loading with Coil</li><li>A UI layer built with Compose Multiplatform and styled using <a href="https://github.com/Tweener/czan/">Czan</a>, my open-source atomic design system</li></ul><h3>Who Is KMPShip For?</h3><p>If you’re any of the following:</p><ul><li>🧑‍💻 A solo or indie dev tired of setting up projects from scratch</li><li>🚀 A startup founder looking to launch your MVP fast</li><li>🛠️ A developer wanting to explore Kotlin Multiplatform without the boilerplate pain</li></ul><p>Then shared is made for you.</p><p>You can build virtually any kind of mobile app with it: AI wrappers, personal finance tools, news apps, paid products — you name it.</p><h3>What’s Next?</h3><p>I’ve got tons of ideas in the pipeline: new features, integrations, and launchers to make development even faster. But more on that soon.</p><p>👉 <a href="https://www.kmpship.app/"><strong>Visit the website</strong></a></p><p>Thanks for reading, and happy shipping!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ff974d38a7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Play Search is Broken: Why My App Disappeared & How It Hurts Indie Developers]]></title>
            <link>https://vivienmahe.medium.com/google-play-search-is-broken-why-my-app-disappeared-how-it-hurts-indie-developers-702969ce0d95?source=rss-15ccf1319eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/702969ce0d95</guid>
            <category><![CDATA[app-store-optimization]]></category>
            <category><![CDATA[indie-app-development]]></category>
            <category><![CDATA[google-play-store]]></category>
            <category><![CDATA[mobile-app-marketing]]></category>
            <category><![CDATA[google-search-algorithm]]></category>
            <dc:creator><![CDATA[Vivien Mahé]]></dc:creator>
            <pubDate>Tue, 25 Feb 2025 08:16:51 GMT</pubDate>
            <atom:updated>2025-02-25T08:16:51.746Z</atom:updated>
            <content:encoded><![CDATA[<h3>My App Disappeared from Google Play Search — Why?</h3><p>I launched my app, <a href="https://bloomeo.app/"><strong>Bloomeo — Save &amp; Retire Early</strong></a>, on <strong>January 29th</strong>, after working on it for several months. Bloomeo is designed to help users take control of their finances, budget effectively, and plan for financial independence. The app provides insights into savings, spending, and long-term financial growth, allowing users to <strong>track their net worth over time</strong>. Since its launch, Bloomeo has steadily grown, attracting users who are serious about improving their financial future.</p><p>For weeks, my app, <strong>Bloomeo — Save &amp; Retire Early</strong>, was easy to find on Google Play. Users could search for <strong>“Bloomeo”</strong>, and there it was — simple, as it should be.</p><p>Then, out of nowhere, my app completely <strong>disappeared from search results</strong> for its own name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ak67GeKGFqObL2GLs4Rw-Q.png" /><figcaption>Searching for the exact name doesn’t show my app — but adding a second word does. How does that make sense?</figcaption></figure><p>This isn’t just an inconvenience. It directly impacts my app’s <strong>downloads, ratings, and revenue</strong>. If people can’t find my app when searching for its name, they won’t download it. And fewer downloads mean fewer reviews, making it even harder to gain visibility.</p><h3>The Problem</h3><p>I reached out to Google Play Developer Support. Their first response?</p><blockquote><em>“Search rankings change over time as new apps are added.”</em></blockquote><p>But there were <strong>no new apps</strong> with the name “Bloomeo.” I wasn’t competing against hundreds of similar apps. My app should have remained <strong>the first or second result</strong> for an exact match.</p><p>And then things got even weirder.</p><p>If you search <strong>“Bloomeo Bloomeo”</strong>, my app appears. If you search <strong>“Bloomeo”</strong>, it doesn’t. 🤨 If you search <strong>““Bloomeo””</strong> (with quotes), it <strong>does</strong> appear.</p><p>So, my app is in the search index, but Google’s algorithm refuses to show it for the most common way users search for an app: by its <strong>exact name</strong>.</p><h3>Google’s Explanation (or Lack of One)</h3><p>After pressing them for a real answer, I got this:</p><blockquote><em>“We cannot guarantee that every app will display in search results for its name.”</em></blockquote><p>Wait — <strong>what?!</strong></p><p>If an exact name match isn’t enough to show an app in search results, how are users supposed to discover new apps? This isn’t a minor ranking change — this is an app being completely wiped from visibility.</p><p>Google’s suggestion?</p><ul><li><strong>“Share a direct link.”. </strong>Great, but new users won’t randomly stumble upon my app this way.</li><li><strong>“Run a paid Google Ads campaign.”.</strong> So now I have to <strong>pay Google</strong> just to show up for my own app name?</li></ul><h3>The Real Impact on My App</h3><p>This isn’t just frustrating — it’s <strong>severely impacting my app’s growth</strong>.</p><ul><li><strong>Downloads have dropped</strong> since users can’t find the app organically.</li><li><strong>Fewer downloads mean fewer reviews</strong>, which hurts my app’s credibility.</li><li><strong>Revenue is impacted</strong> because organic discovery is a key driver of growth.</li></ul><p>Google Play’s search algorithm is supposed to <strong>help users find relevant apps</strong>, yet here it is actively hiding mine.</p><h3>How This Hurts Indie Developers</h3><ul><li>Big apps already dominate search rankings.</li><li>Now, even an <strong>exact name match</strong> won’t guarantee your app appears.</li><li>Google’s “solution” is <strong>pay-to-play</strong>, forcing small devs to spend on ads just to regain visibility.</li></ul><p>I followed <strong>every ASO best practice</strong>, and my app is fully compliant with Google Play policies. But if Google’s algorithm randomly decides to <strong>hide your app</strong>, there’s nothing you can do.</p><h3>Indie Devs Deserve Better</h3><p>This is a <strong>broken system</strong>. Google Play should not <strong>force small devs into paid ads</strong> just to be found by their own app name.</p><p>If this happened to my app, it can happen to <strong>any indie app</strong>.</p><p>I built Bloomeo to help people take control of their finances, but how can I help users if they can’t even find my app?</p><p>🔗 <strong>You can still find Bloomeo at </strong><a href="https://bloomeo.app/"><strong>bloomeo.app</strong></a></p><p><strong>We need transparency. We need fairness. We need answers.</strong></p><p>If you’re an indie dev experiencing the same issue, let’s talk! Let’s make some noise. Share this article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=702969ce0d95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to publish your own BoM (Bill of Materials) for Kotlin Multiplatform libraries on Maven Central]]></title>
            <link>https://proandroiddev.com/how-to-publish-your-own-bom-billing-of-materials-for-kotlin-multiplatform-libraries-on-maven-b8dd815aa018?source=rss-15ccf1319eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8dd815aa018</guid>
            <category><![CDATA[bill-of-materials]]></category>
            <category><![CDATA[maven-central]]></category>
            <category><![CDATA[sonatype]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Vivien Mahé]]></dc:creator>
            <pubDate>Fri, 08 Mar 2024 09:32:10 GMT</pubDate>
            <atom:updated>2024-03-10T15:51:01.315Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ZX4b5JKtZ-Hq8Me8l0r9g.jpeg" /><figcaption>JetBrains Kotlin Multiplatform + BoM (Bill Of Materials) + Sonatype Maven Central Repository + GitHub Actions</figcaption></figure><p>As a developer working on various <a href="https://www.jetbrains.com/kotlin-multiplatform/">Kotlin Multiplatform</a> projects, whether for your job or just for fun, you might find that as your projects grow, you’ll want to <strong>create your own libraries</strong>. This is a common practice that helps you reuse the same code across different projects, saving time.</p><p>While this practice improves your code quality, over time, you might encounter <strong>dependency version conflicts</strong>, often referred to as “<strong>dependency hell</strong>”. Here’s an example to illustrate what can happen:</p><p>Imagine you are working on two different modules within a project, ModuleA and ModuleB, both depending on the same library, LibraryX. However, ModuleA requires LibraryX version 1.2, while ModuleB needs LibraryX version 1.4 for its additional features.</p><p>When you try to build your project, the build system might fetch and <strong>use different versions</strong> of LibraryX for each module, leading to <strong>inconsistent behavior or compilation errors</strong>. Worse, if both modules are part of the same build process, the build system might only resolve to one version of LibraryX (say 1.2), causing ModuleB to potentially <strong>fail at runtime</strong> due to missing features available only in 1.4.</p><p>With a BoM (<a href="https://kotlinlang.org/docs/gradle-configure-project.html#other-ways-to-align-versions">Bill of Materials</a>), you could <strong>centrally</strong> manage the version of LibraryX, ensuring that <strong>all modules use a compatible version</strong>, or identify and resolve the version conflict upfront, deciding whether to upgrade ModuleA to use LibraryX 1.4 or find a different solution that suits both modules. This centralized management helps <strong>maintain consistency</strong>, <strong>reduces the risk of runtime issues</strong>, and <strong>simplifies dependency updates</strong> and troubleshooting.</p><p>Here are some examples of famous libraries using a BoM:</p><ul><li><a href="https://firebase.google.com/docs/android/learn-more#bom">Firebase Android BoM</a></li><li><a href="https://developer.android.com/jetpack/compose/setup#setup-compose">Jetpack Compose</a></li><li><a href="https://kotlinlang.org/docs/gradle-configure-project.html#other-ways-to-align-versions">Kotlin BoM</a></li></ul><p>Here’s a summary of the process explained in this article:</p><p>· <a href="#edc8">The project structure</a><br>· <a href="#487f">The BoM configuration</a><br>· <a href="#5702">Add the BoM as a dependency in your projects</a><br>· <a href="#594c">Publish your BoM library to Maven Central via GitHub Actions</a><br>· <a href="#0f1b">Check your BoM library on Maven Central</a></p><p><strong>⚠️ Important</strong>: I assume you already have a working setup to automatically publish a KMP library to Maven Central repository. If this is not the case, I recommend you read my article “<a href="https://vivienmahe.medium.com/how-to-publish-your-kotlin-multiplatform-library-on-maven-central-5340deff7ee5"><strong>How to publish your Kotlin Multiplatform library on Maven Central</strong></a>”:</p><p><a href="https://vivienmahe.medium.com/how-to-publish-your-kotlin-multiplatform-library-on-maven-central-5340deff7ee5">How to publish your Kotlin Multiplatform library on Maven Central</a></p><h3>The project structure</h3><p>A few key elements are required to create a BoM:</p><ul><li>You need a <strong>multi-module project</strong>, where each module is a library.</li><li>An <strong>additional module</strong> is dedicated to the BoM configuration. This module <strong>contains only one file</strong> (build.gradle.kts) and does not include any code, resources, or other files. (We will create it later on.)</li></ul><p>➡️ By default, every module that sets up a MavenPublication within that multi-module project is <strong>automatically included</strong> in the BoM.</p><p>Here’s what the project structure looks like:</p><pre><strong>myproject</strong> (root)<br>  ├── build.gradle.kts<br>  ├── <strong>bom</strong> (specific module for BoM configuration)<br>  │     ├── build.gradle.kts<br>  ├── <strong>library1</strong> (module)<br>  │     ├── build.gradle.kts<br>  │     ├── src<br>  ├── <strong>library2</strong> (module)<br>  │     ├── build.gradle.kts<br>  │     ├── src</pre><p>In this example, the BoM will include library1 and library2.</p><p>For my <a href="https://github.com/Tweener/kmp-bom"><strong>kmp-bom</strong></a> project, with the default configuration, the BoM will include the following modules: kmp-common , kmp-firebase and kmp-realm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/213/1*y6jw0q5kSInTMZV0ScbIOQ.png" /><figcaption>Project structure of my <a href="https://github.com/Tweener/kmp-bom">Tweener/kmp-bom</a> project</figcaption></figure><p>If you don’t know how to setup a multi-module project, follow the official Gradle documentation here: <a href="https://docs.gradle.org/current/userguide/multi_project_builds.html">https://docs.gradle.org/current/userguide/multi_project_builds.html</a></p><h3>The BoM configuration</h3><p>A BoM is typically a Maven <a href="https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#bill-of-materials-bom-poms"><strong>pom.xml</strong></a> file where all the libraries are listed along with their specific version numbers, providing a centralized reference for managing project dependencies:</p><pre>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;<br>    xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;<br>  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;<br>  &lt;groupId&gt;com.test&lt;/groupId&gt;<br>  &lt;artifactId&gt;bom&lt;/artifactId&gt;<br>  &lt;version&gt;1.0.0&lt;/version&gt;<br>  &lt;packaging&gt;pom&lt;/packaging&gt;<br>  &lt;properties&gt;<br>    &lt;project1Version&gt;1.0.0&lt;/project1Version&gt;<br>    &lt;project2Version&gt;1.0.0&lt;/project2Version&gt;<br>  &lt;/properties&gt;<br> <br>  &lt;dependencyManagement&gt;<br>    &lt;dependencies&gt;<br>      &lt;dependency&gt;<br>        &lt;groupId&gt;com.test&lt;/groupId&gt;<br>        &lt;artifactId&gt;project1&lt;/artifactId&gt;<br>        &lt;version&gt;${project1Version}&lt;/version&gt;<br>      &lt;/dependency&gt;<br>      &lt;dependency&gt;<br>        &lt;groupId&gt;com.test&lt;/groupId&gt;<br>        &lt;artifactId&gt;project2&lt;/artifactId&gt;<br>        &lt;version&gt;${project2Version}&lt;/version&gt;<br>      &lt;/dependency&gt;<br>    &lt;/dependencies&gt;<br>  &lt;/dependencyManagement&gt;<br> <br>  &lt;modules&gt;<br>    &lt;module&gt;parent&lt;/module&gt;<br>  &lt;/modules&gt;<br>&lt;/project&gt;</pre><p>Now, you could create this pom.xml file and update it manually every time one of your libraries has a new version. However, we prefer to <strong>automate the process</strong> so that this pom.xml file is automatically generated.</p><p>➡️ To do so, we use this <a href="https://github.com/gradle-bom/gradle-bom-generator-plugin">Gradle plugin</a> that does a pretty good job with minimum configuration:</p><ul><li>Configure the plugin for the <strong>pom.xmlfile generation</strong>.</li><li>Configure <strong>publishing</strong> to Maven Central and <strong>signing</strong> with GPG.</li></ul><p>In your bom module (the specific module for the BoM configuration), create a build.gradle.kts file and add the following lines:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ec33683ff0c9b3a2d01ba5864cf2e5c/href">https://medium.com/media/9ec33683ff0c9b3a2d01ba5864cf2e5c/href</a></iframe><h4>Exclude module from the BoM:</h4><p>If you want to exclude a module from being collected into the BoM, you can add the excludeProject configuration to your bom module’s build.gradle.kts:</p><pre>bomGenerator {<br>    excludeProject(&quot;excluded-module&quot;)<br>}</pre><h4>Include external dependencies to theBoM:</h4><p>You can also include external dependencies (from outside this project) to your BoM, by adding the includeDependency configuration to your bom module’s build.gradle.kts:</p><pre>bomGenerator {<br>    includeDependency(&quot;io.github.tweener:kmp-charts:&quot;)<br>}</pre><h4>Verify your BoM configuration:</h4><p>To verify that this configuration is correctly set, you can <strong>deploy your BoM library to your local Maven repository</strong> using the publishToMavenLocal Gradle task:</p><pre>./gradlew publishToMavenLocal</pre><h3>Add the BoM as a dependency in your projects</h3><p>To use the BoM as a dependency in your projects, you must first add the BoM dependency itself, followed by the specific libraries you need:</p><pre>implementation(project.dependencies.platform(&quot;com.company.example:bom:1.0.0&quot;))<br>implementation(&quot;com.company.example:library1&quot;)<br>implementation(&quot;com.company.example:library2&quot;)</pre><p>For instance, if the BoM specifies library1 to be at version 1.0.0 and library2 at version 2.0.0, <strong>you don’t need to specify these versions</strong> when adding the dependencies to these libraries.</p><h3>Publish your BoM library to Maven Central via GitHub Actions</h3><p>This is the last step of this process. After testing your BoM library and publishing it to your local Maven repository, you’re now ready to <strong>automate its publication to Maven Central</strong> using GitHub Actions.</p><p>➡️ To do so, follow <a href="https://vivienmahe.medium.com/how-to-publish-your-kotlin-multiplatform-library-on-maven-central-5340deff7ee5#c6a4">these instructions</a> from my other article.</p><p>There is <strong>only one difference</strong> in the setup: we need to specifically call the Gradle task to generate the pom.xml file when executing the publish GitHub Actions workflow:</p><pre>./gradlew publishBomPublicationToSonatypeRepository</pre><p>So here’s what the publish.xml looks like for a BoM library:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b0ba2297b7b6f388405db3fbe90b0163/href">https://medium.com/media/b0ba2297b7b6f388405db3fbe90b0163/href</a></iframe><h3>Check your BoM library on Maven Central</h3><p>With this, your library is now fully set up for automated publishing on Maven Central. After creating a release version of your library, it will be accessible via a URL provided by Sonatype.</p><p>For example, in my case, my BoM has 3 libraries: kmp-common, kmp-firebase, kmp-realm. The URL is:</p><blockquote><a href="https://repo1.maven.org/maven2/io/github/tweener/"><em>https://repo1.maven.org/maven2/io/github/tweener/</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*FjjOt5bWkvlEU6hJiOIcnA.jpeg" /></figure><p>For a <strong>full example</strong> and source code, check out my <a href="https://github.com/Tweener/kmp-bom"><strong>kmp-bom</strong></a> repository:</p><p><a href="https://github.com/Tweener/kmp-bom">GitHub - Tweener/kmp-bom: Tweener Kotlin Multiplatform SDK</a></p><p>That’s all for this article! I hope you found it helpful, I would greatly appreciate your feedback! 🙏</p><p>Feel free to leave a comment below or reach out to me directly:</p><ul><li>On <strong>X/Twitter</strong>: <a href="https://twitter.com/VivienMahe">@VivienMahe</a></li><li>On <strong>my website</strong>: <a href="https://vivienmahe.com/">vivienmahe.com</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8dd815aa018" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/how-to-publish-your-own-bom-billing-of-materials-for-kotlin-multiplatform-libraries-on-maven-b8dd815aa018">How to publish your own BoM (Bill of Materials) for Kotlin Multiplatform libraries on Maven Central</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to publish your Kotlin Multiplatform library on Maven Central]]></title>
            <link>https://vivienmahe.medium.com/how-to-publish-your-kotlin-multiplatform-library-on-maven-central-5340deff7ee5?source=rss-15ccf1319eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5340deff7ee5</guid>
            <category><![CDATA[jitpack]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[maven-central]]></category>
            <dc:creator><![CDATA[Vivien Mahé]]></dc:creator>
            <pubDate>Fri, 23 Feb 2024 10:08:06 GMT</pubDate>
            <atom:updated>2024-03-03T19:02:34.879Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zr5JKROKbeRGc7a_rmJvCQ.png" /><figcaption>JetBrains Kotlin Multiplatform + Sonatype Maven Central Repository + GitHub Actions</figcaption></figure><p>Whether you’re new to <a href="https://www.jetbrains.com/kotlin-multiplatform/"><strong>Kotlin Multiplatform</strong></a> development or you already have some experience with it, you might find yourself needing to <strong>create your own library</strong> for use in your projects or to make it publicly available.</p><p>If you come from the Java or Android world, you’re likely familiar with <a href="https://jitpack.io/">JitPack</a>, a <strong>package repository</strong> for JVM and Android projects. JitPack automatically builds GitHub repositories and provides the artifacts through a regular Gradle dependency.</p><p>However, as of the date of this article, <strong>JitPack is not yet compatible with Kotlin Multiplatform</strong>. This is due to the fact that <a href="https://github.com/jitpack/jitpack.io/issues/3853">JitPack builds exclusively on Linux, not macOS</a>, which is necessary for building native targets (e.g., iOS).</p><p>I do hope this limitation is addressed soon, as I appreciate JitPack for its simplicity and efficiency.</p><p>In the meantime, we must explore other options. One of the most <strong>popular alternatives is </strong><a href="https://central.sonatype.com/"><strong>Maven Central</strong></a>, with Sonatype as the company behind it. Setting up your library for publication on Maven Central is unfortunately not as straightforward as with JitPack. However, through this article, I hope to demonstrate that the process is manageable after you’ve gone through it once.</p><p>Here’s a summary of the process explained in this article:</p><p>· <a href="#8287">Create your Sonatype account and register your namespace</a><br>· <a href="#4843">Configure GnuPG to sign your artifacts</a><br>· <a href="#4453">Configure Gradle for your library</a><br>· <a href="#c6a4">Publish your library to Maven Central via Github Actions</a><br>· <a href="#2e6d">Check your library on Maven Central</a></p><h3>Create your Sonatype account and register your namespace</h3><blockquote>Since February 1st, 2024, Sonatype has changed the account creation process. It is no longer possible to create an account through <a href="https://issues.sonatype.org/">https://issues.sonatype.org/</a>, as this method is now considered legacy.</blockquote><p>The first step is to create your Sonatype account, opting for the <strong>email/password option</strong>, as these credentials will be necessary later during the Gradle library configuration.</p><p>Next, you must select a <strong>namespace</strong> (also known as ‘groupId’). This namespace uniquely <strong>identifies your top-level project or organization</strong> among all other publishers on Maven Central.</p><p>For example, choosing the namespace io.github.mycompany means that all projects you publish on Maven Central will be part of this namespace. Thus, each project would be identified uniquely, for instance, as io.github.mycompany.myfirstproject, io.github.mycompany.mysecondproject, and so on.</p><p>➡️ To <strong>create your Sonatype account</strong> and get <strong>choose your namespace</strong>, follow the official instructions here: <a href="https://central.sonatype.org/register/central-portal/">https://central.sonatype.org/register/central-portal/</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LfEBibUOzrZFO5XR8BejZg.jpeg" /><figcaption>Click the Sign In button in the top right corner</figcaption></figure><p>Once you’re done with this process, you can retrieve your <strong>Staging Profile ID</strong>, which is required when Gradle will upload your artifacts to Maven Central.</p><p>➡️ Create and login to your Nexus account here: <a href="https://s01.oss.sonatype.org/">https://s01.oss.sonatype.org/</a> and get the Staging Profile ID from the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u_O_3SPN3fPvgQ67B4PhLw.jpeg" /></figure><h3>Configure GnuPG to sign your artifacts</h3><p>To publish an <strong>artifact</strong> on Maven Central, it <strong>must first be signed</strong>. This is accomplished using <a href="https://www.gnupg.org/">GnuPG</a> (GPG), a free software that implements the OpenPGP standard.</p><p>You will need to <strong>generate a key pair</strong> with GPG to sign your artifacts and then distribute this key to a server, allowing users to verify its authenticity.</p><p>➡️ Follow the official instructions here: <a href="https://central.sonatype.org/publish/requirements/gpg/">https://central.sonatype.org/publish/requirements/gpg/</a></p><p>After completing these steps, you will have:</p><ul><li>A long-format <strong>keyId</strong>, which resembles something like this: CA925CD6C9E8D064FF05B4728190C4130ABA0F98 .</li><li>A <strong>passphrase</strong> which is the password you selected during the key pair creation process.</li></ul><pre>$ gpg --list-keys<br>/home/mylocaluser/.gnupg/pubring.kbx<br>---------------------------------<br>pub   rsa3072 2021-06-23 [SC] [expires: 2023-06-23]<br>      CA925CD6C9E8D064FF05B4728190C4130ABA0F98 # &lt;-- The long-format keyId<br>uid           [ultimate] Central Repo Test &lt;central@example.com&gt;<br>sub   rsa3072 2021-06-23 [E] [expires: 2023-06-23]</pre><p>Now that we have the long-format key ID and the passphrase, there’s one last requirement: the <strong>GPG secret key</strong>.</p><p>You can retrieve and export it to your clipboard with the following command:</p><pre># macOS<br>$ gpg --armor --export-secret-key central@example.com | pbcopy<br><br># Ubuntu (assuming GNU base64)<br>$ gpg --armor --export-secret-key central@example.com | xclip<br><br># Arch<br>$ gpg --armor --export-secret-key central@example.com | xclip -selection clipboard -i<br><br># FreeBSD (assuming BSD base64)<br>$ gpg --armor --export-secret-key central@example.com | xclip<br></pre><h3>Configure Gradle for your library</h3><p>Now that you’ve set up your Sonatype account and prepared GPG for artifact signing, the next step is to <strong>configure your library via Gradle</strong>. This enables Gradle to build the library, sign it with GPG, and publish it to Maven Central.</p><p>In a typical development workflow, it’s crucial to publish and test the library locally to ensure everything functions correctly before making a public release. Therefore, you need to set up Gradle to publish our library both to the <strong>local Maven repository</strong> (on your computer) and to <strong>Maven Central via your Sonatype account</strong>.</p><p>To begin with local publishing, open your local.properties file and add the following properties:</p><pre>sonatype.username={INSERT HERE YOUR SONATYPE ACCOUNT USERNAME}<br>sonatype.password={INSERT HERE YOUR SONATYPE ACCOUNT PASSWORD}<br>sonatype.stagingProfileId={INSERT HERE YOUR SONATYPE STAGING PROFILE ID}<br>signing.key=&quot;{INSERT HERE YOUR GPG PRIVATE SIGNING KEY}&quot;<br>signing.password=&quot;{INSERT HERE YOUR GPG SIGNING PASSPHRASE}&quot;</pre><p>Next, you must instruct Gradle on the <strong>destination for publishing</strong> the library on Maven Central. To do this, open your project’s root build.gradle.kts file and add the following lines:</p><pre>import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties<br><br>plugins {<br>    kotlin(&quot;multiplatform&quot;).version(&quot;1.9.21&quot;).apply(false)<br>    id(&quot;com.android.library&quot;).version(&quot;8.1.4&quot;).apply(false)<br>    id(&quot;org.jetbrains.dokka&quot;).version(&quot;1.9.10&quot;).apply(false)<br>    id(&quot;io.github.gradle-nexus.publish-plugin&quot;).version(&quot;2.0.0-rc-1&quot;)<br>    ...<br>}<br><br>nexusPublishing {<br>    repositories {<br>        sonatype {<br>            nexusUrl.set(uri(&quot;https://s01.oss.sonatype.org/service/local/&quot;))<br>            snapshotRepositoryUrl.set(uri(&quot;https://s01.oss.sonatype.org/content/repositories/snapshots/&quot;))<br>            username.set(gradleLocalProperties(rootDir).getProperty(&quot;sonatype.username&quot;) ?: System.getenv(&quot;OSSRH_USERNAME&quot;))<br>            password.set(gradleLocalProperties(rootDir).getProperty(&quot;sonatype.password&quot;) ?: System.getenv(&quot;OSSRH_PASSWORD&quot;))<br>            stagingProfileId.set(gradleLocalProperties(rootDir).getProperty(&quot;sonatype.stagingProfileId&quot;) ?: System.getenv(&quot;OSSRH_STAGING_PROFILE_ID&quot;))<br>        }<br>    }<br>}</pre><p>Finally, you need to configure Gradle for the library’s publishing and GPG signing:</p><ul><li><a href="https://github.com/Kotlin/dokka">Dokka</a> is used to <strong>automatically generate the library’s documentation</strong>, a requirement set by Sonatype for publishing.</li><li>Gradle is configured to <strong>generate the POM file</strong>, detailing the library’s name, description, license, developer information, etc.</li><li>The library is <strong>signed with GPG</strong>.</li></ul><p>To implement these settings, open your library module’s build.gradle.kts file. Add the following lines, ensuring to modify the values as necessary:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c14d1c400c1b2b3e9c5422be2664f841/href">https://medium.com/media/c14d1c400c1b2b3e9c5422be2664f841/href</a></iframe><p>To verify that this configuration is correctly set, you can <strong>deploy your library to your local Maven repository</strong> using the publishToMavenLocal Gradle task:</p><pre>./gradlew publishToMavenLocal</pre><h3>Publish your library to Maven Central via GitHub Actions</h3><p>This is the last step of this process. After testing your library and publishing it to your local Maven repository, you’re now ready to <strong>automate its publication to Maven Central</strong> using GitHub Actions.</p><p>First, configure the following <a href="https://docs.github.com/en/actions/security-guides/encrypted-secrets">GitHub Actions secrets</a> within your repository:</p><ul><li>OSSRH_GPG_SECRET_KEY: The generated secret key value.</li><li>OSSRH_GPG_SECRET_KEY_ID: The keyId of the generated secret key (<strong>only the last 16 characters</strong>).</li><li>OSSRH_GPG_SECRET_KEY_PASSWORD: The passphrase for your generated secret key.</li><li>OSSRH_PASSWORD: The password for your Sonatype account.</li><li>OSSRH_STAGING_PROFILE_ID: The staging profile ID assigned by Sonatype.</li><li>OSSRH_USERNAME: The username for your Sonatype account.</li></ul><p>Next, proceed to create two GitHub Actions workflows:</p><ul><li><strong>buildRelease.yml</strong>: Build your KMP library. It will build the Android target on a Linux distribution and the iOS target on a MacOS.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce881b16fdd0731d92685f76e4ee172f/href">https://medium.com/media/ce881b16fdd0731d92685f76e4ee172f/href</a></iframe><ul><li><strong>publish.yml</strong>: Publish your KMP library on Maven Central. This workflow will be <strong>automatically executed when a new release version is created</strong> on your repository.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3b21ca409a2c14a6a2e6cfbe6957dd45/href">https://medium.com/media/3b21ca409a2c14a6a2e6cfbe6957dd45/href</a></iframe><h3>Check your library on Maven Central</h3><p>With this, your library is now fully set up for automated publishing on Maven Central. After creating a release version of your library, it will be accessible via a URL provided by Sonatype. For example, in my case, the URL is:</p><blockquote><a href="https://repo1.maven.org/maven2/io/github/tweener/">https://repo1.maven.org/maven2/io/github/tweener/</a></blockquote><p>You can include it in your projects as a dependency with the following line:</p><pre>implementation(&quot;io.github.tweener:czan:2.1.0&quot;)</pre><p>The source code is available on this <a href="https://github.com/Tweener/kmplate-lib">GitHub repository</a>. I encourage you to clone this template to create your own library!</p><p>For a <strong>practical example</strong>, check out <a href="https://github.com/Tweener/c-zan"><strong>C-ZAN</strong></a>, my open-source design system library for apps running on Compose Multiplatform:</p><p><a href="https://github.com/Tweener/c-zan">GitHub - Tweener/c-zan: C·ZAN is an atomic design system for apps running on Compose Multiplatform</a></p><p>I find the process of publishing to Maven Central somewhat challenging, but once you went through with it for your first library, it becomes <strong>much more straightforward</strong> for your next ones.</p><p>That’s all for this article! I hope you found it helpful, I would greatly appreciate your feedback! 🙏</p><p>Feel free to leave a comment below or reach out to me directly:</p><ul><li>On <strong>X/Twitter</strong>: <a href="https://twitter.com/VivienMahe">@VivienMahe</a></li><li>On <strong>my website</strong>: <a href="https://vivienmahe.com/">vivienmahe.com</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5340deff7ee5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure your ChatGPT API key on mobile and avoid leaks]]></title>
            <link>https://vivienmahe.medium.com/secure-your-chatgpt-api-key-on-mobile-and-avoid-leaks-d5c9ea4c1f84?source=rss-15ccf1319eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5c9ea4c1f84</guid>
            <category><![CDATA[leaked]]></category>
            <category><![CDATA[firebase-cloud-functions]]></category>
            <category><![CDATA[openai-chatgpt]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[google-secret-manager]]></category>
            <dc:creator><![CDATA[Vivien Mahé]]></dc:creator>
            <pubDate>Tue, 30 Jan 2024 10:01:16 GMT</pubDate>
            <atom:updated>2024-02-23T11:26:17.289Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3I7MqVoFK45XdlYd" /><figcaption>Photo by <a href="https://unsplash.com/@siva_photography?utm_source=medium&amp;utm_medium=referral">Levart_Photographer</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you’ve been keeping up with recent news on products utilizing the <a href="https://openai.com/blog/openai-api">OpenAI API</a>, you may have come across some unfortunate stories. There have been incidents of ChatGPT API keys being leaked and subsequently exploited by hackers. This has led to substantial, unexpected bills for the affected parties.</p><p>Many stories are available, but I’ve preselected a few for you:</p><ul><li>Ray Fernando on YouTube: <a href="https://youtu.be/_ueiYhLwwBc?si=zfW7kwk8JjKmv13V">Don’t make this AI mistake</a></li><li>Helge Sverre on <a href="https://twitter.com/HelgeSverre/status/1662711568595927040">X/Twitter</a></li><li>Rodolfo Ocampo on <a href="https://twitter.com/_RodolfoOcampo/status/1663158336194514944">X/Twitter</a></li></ul><p>If this is news to you, let me offer a quick summary that could <strong>save you both time and money</strong>.</p><h3>A little bit of context</h3><p>To integrate ChatGPT, DALL·E, or other models into your project, you need to utilize the <a href="https://platform.openai.com/docs/api-reference">OpenAI API</a>. This API facilitates communication between your project and the service. Be aware that the API is not free, and costs vary based on usage. (For a more detailed understanding of their pricing, I recommend visiting the OpenAI <a href="http://pricing page">pricing page</a>, though I won’t delve into those details here).</p><p>Authentication is required for the API to identify the client (whether it’s a mobile or web app) and to monitor API usage. To achieve this, you must create an API key through your OpenAI account and include it in every request to the API. This is typically done through the Authorization HTTP header in the format: Authorization: Bearer {OPENAI_API_KEY}.</p><p><strong>And this is precisely where the security leaks occur!</strong></p><p>When you send an HTTP request to a server, <strong>the headers, which include your API key, are visible</strong>. These can be easily intercepted using tools like <a href="https://proxyman.io/">Proxyman</a>, <a href="https://www.charlesproxy.com/">Charles Proxy</a>, and others.</p><p>What are the implications? For example, if you incorporate ChatGPT in your mobile app, anyone who has downloaded your app could potentially intercept the communication between your app and the OpenAI API. In doing so, they could retrieve your API key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ZownJucCUv5lv1LPCErBQ.jpeg" /><figcaption>Proxyman screenshot - edited to show the OpenAI API key in HTTP headers</figcaption></figure><p>At this point, to prevent hackers from misusing your API key and to control your expenses, your only option is to delete the key from your OpenAI account and remove your app from the stores. (Simply updating your app with a new, rotated key doesn’t solve the problem, as it’s susceptible to the same issue.)</p><blockquote><em>Remember, this caution isn’t exclusive to your OpenAI API key; it applies to any secret API key that shouldn’t be exposed.</em></blockquote><p><em>Since I needed to use ChatGPT for my latest project, I began searching for a solution before even considering publishing my app. If you’re curious about my app, Quotell, you can check it out here: </em><a href="http://quotell.me/"><em>quotell.me</em></a><em>.</em></p><h3>Solution: Firebase + Google Secret Manager</h3><p>If you’re a mobile developer like me, you often face situations where backend logic is necessary, but deploying a full-fledged backend might not be desirable. It can be time-consuming and require more effort than you’re willing to invest.</p><p>That’s why I opted for Firebase. It’s user-friendly and quick to set up. Firebase takes care of various aspects like authentication, database management, remote configuration, and more. Most importantly for our discussion, it offers <strong>Cloud Functions</strong>.</p><blockquote>A Cloud Function is essentially an API endpoint hosted on Firebase. For example, if your project is named <em>MyNewProject</em> and you create a function called <em>addUser</em>, your endpoint would be something like:<br><em>https://us-central1-mynewproject.cloudfunctions.net/addUser</em></blockquote><p>The solution, in brief, involves two key steps:</p><ul><li><strong>Use </strong><a href="https://firebase.google.com/docs/functions"><strong>Cloud Functions</strong></a><strong> as a middleman</strong>: Think of it as our backend. The workflow goes like this: The mobile app sends a request to Cloud Functions &gt; Cloud Functions then calls the OpenAI API &gt; The OpenAI API responds to Cloud Functions &gt; Finally, Cloud Functions relays this response back to the mobile app.</li><li><strong>Use </strong><a href="https://cloud.google.com/security/products/secret-manager"><strong>Google Secret Manager</strong></a><strong> for storing the OpenAI API key</strong>: This is a secure and cost-effective way to manage all your confidential data, usually at little to no cost.</li></ul><p><em>(Note: There are alternative solutions that you might consider, depending on your specific needs. I chose this approach because it’s straightforward to set up and doesn’t require a separate backend.)</em></p><p>Let’s break down the process into clear, manageable steps for setting up the entire system:</p><p>∘ <a href="#7c1a">1. Select a Firebase project</a><br> ∘ <a href="#bd66">2. Store OpenAI API key in Google Secret Manager</a><br> ∘ <a href="#6536">3. Setup Firebase Cloud Functions</a><br> ∘ <a href="#1ed4">4. Create and configure your function locally</a><br> ∘ <a href="#3db9">5. Get the code to call OpenAI API with Firebase Cloud Functions</a><br> ∘ <a href="#5a2f">6. Install required dependencies</a><br> ∘ <a href="#2894">7. Test on local Firebase emulators</a><br> ∘ <a href="#39c7">8. Deploy your function to production</a><br> ∘ <a href="#0c0d">9. Add permissions to call your function</a><br> ∘ <a href="#c2e9">10. Configure your mobile app to call your function</a></p><h4>1. Select a Firebase project</h4><p>First, create a new Firebase project if you haven’t already (you can follow the <a href="https://firebase.google.com/">official documentation</a> for guidance), or select an existing one to proceed with.</p><h4>2. Store OpenAI API key in Google Secret Manager</h4><ul><li>Navigate to <a href="https://cloud.google.com/security/products/secret-manager">Google Secret Manager</a> and set up your account by following the provided instructions.</li><li>After setting up your account, <a href="https://console.cloud.google.com/security/secret-manager">select your project</a> using the drop-down menu located in the top left corner of the screen.</li><li>Click on the “+ Create secret” button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*ve1Ws-pUBhXkRkBtMhho1Q.png" /><figcaption>Create a new secret</figcaption></figure><ul><li>On the creation screen, enter OPENAPI_API_KEY in the ‘Name’ field. Then, in the ‘Secret value’ field, paste your OpenAI API key, which you can find in your OpenAI account.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*MQmKWXffQYWvr-ctJbRWNA.jpeg" /><figcaption>Save your OpenAI API key to Google Secret Manager</figcaption></figure><p>Your OpenAI API key is now securely stored in your Google Secret Manager account. You can return to this platform anytime you need to rotate, delete, or create a new key.</p><h4>3. Setup Firebase Cloud Functions</h4><p>In Firebase, ensure that your project is selected. Then, navigate to ‘Functions’ by clicking on ‘Build’ and then ‘Functions’ in the left-hand menu. You will be prompted to upgrade your plan from the free ‘Spark’ to the ‘Blaze’ pay-as-you-go plan. (<em>It’s important to read through the pricing details, but note that you will not incur charges until you reach a significant usage limit.</em>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*96zyl8PDHs4PjJpYiKG8PA.png" /><figcaption>Firebase left panel to access Functions</figcaption></figure><h4>4. Create and configure your function locally</h4><p>To set up a Cloud Function on Firebase, you’ll first need to create and test it locally on your machine using the Firebase CLI, and then deploy it.</p><p>Follow the steps in <a href="https://firebase.google.com/docs/functions/get-started?authuser=2&amp;hl=en&amp;gen=2nd#set-up-your-environment-and-the-firebase-cli">this documentation</a> to install Firebase CLI on your local machine, focusing on steps 2 through 4.</p><p>➡️ When selecting a language, choose <strong>JavaScript</strong> (this is important for our purpose).</p><p>➡️ You can skip step 5 (<em>Add the &quot;add message&quot; function</em>) and step 6 (<em>Add the &quot;make uppercase&quot; function</em>) as they are not necessary for our project.</p><p>When using Firebase CLI, begin by authenticating with the command firebase login. This command will provide a URL to open in your browser.</p><p>⚠️ If you encounter an error like Failed to get Firebase project MyNewProject. Please make sure the project exists and your account has permission to access it., it&#39;s likely due to an expired session. To resolve this, type firebase logout and then firebase login again.</p><h4>5. Get the code to call OpenAI API with Firebase Cloud Functions</h4><p>To streamline the process, I’ve prepared a gist containing the necessary code for the Cloud Function. On your local machine, simply replace the contents of functions/index.js with the code from this gist:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/18a4c258723fc8b92ec1bd6f070b4deb/href">https://medium.com/media/18a4c258723fc8b92ec1bd6f070b4deb/href</a></iframe><p>Here’s what it does in a few words:</p><ul><li>Retrieves the OpenAI API key from your Google Secret Manager account.</li><li>Verifies that the request method is a POST.</li><li>Checks for user authentication against Firebase and validates the user’s ID token.</li><li>Configures and sends the request to the OpenAI API and then forwards the received response to the Firebase client, which is your mobile app.</li></ul><p><em>This is just one example of how you can use Google Cloud Function to interact with the OpenAI API. Feel free to modify it according to your project’s requirements!<br>As I’m not primarily a JavaScript developer, any feedback, suggestions for improvement, or corrections are greatly appreciated 🙂</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*fLk9NFjElGgfbItexaky1g.png" /><figcaption>Extract from the gist — Request sent to OpenAI API</figcaption></figure><h4>6. Install required dependencies</h4><p>To ensure the script from the gist functions correctly, we need to install two essential dependencies:</p><ul><li><a href="https://github.com/axios/axios">Axios</a>: A HTTP client for Node.js.</li><li><a href="https://www.npmjs.com/package/cors">CORS</a> (<strong>C</strong>ross-<a href="https://www.npmjs.com/package/cors">O</a>rigin <strong>R</strong>esource <strong>S</strong>haring): A mechanism used to restrict access to specific domains.</li></ul><p>To install these, open the terminal on your machine and navigate to the root directory of your project. Then, move into the functions directory using the command cd functions/. Once in the directory, execute the following command: npm install axios cors.</p><h4>7. Test on local Firebase emulators</h4><p>By this stage, you should be ready to test your Firebase Cloud Function locally on your machine. Firebase CLI will provide you with a URL to use for testing. This URL typically looks something like this:<br><a href="http://127.0.0.1:5001/mynewproject/us-central1/addUser.">http://127.0.0.1:5001/mynewproject/us-central1/addUser</a></p><p><em>I highly recommend testing the setup using an API platform like </em><a href="https://www.postman.com/"><em>Postman</em></a><em>. This will help you ensure that the communication between Firebase Cloud Functions and the OpenAI API is functioning as expected. Once you’re satisfied with the test results, you can then proceed to implement the mobile part of your project.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j1fx0E2_X1finCWgq-LgXQ.jpeg" /><figcaption>Firebase CLI on emulators</figcaption></figure><h4>8. Deploy your function to production</h4><p>Once everything is functioning flawlessly on your local machine, it’s time to deploy your project to production using Firebase Cloud Functions.</p><p>You can follow step 8 of the provided <a href="https://firebase.google.com/docs/functions/get-started?authuser=2&amp;hl=en&amp;gen=2nd#deploy-functions-to-a-production-environment">documentation</a>, or simply execute the following command in your terminal: firebase deploy.</p><p>Upon successful deployment, Firebase will provide you with the production URL, which should look something like this:<br><a href="https://us-central1-mynewproject.cloudfunctions.net/addUser"><em>https://us-central1-mynewproject.cloudfunctions.net/addUser</em></a></p><h4>9. Add permissions to call your function</h4><p>By default, your function is not accessible via the production URL due to missing permissions. To enable access, you need to grant permission for anyone to call this URL.</p><p>Firstly, ensure that you complete a <strong>successful deployment of your function</strong>. Once the deployment is successful, the next step is to <strong>grant access permissions</strong>. You do this by adding the Cloud Functions Invoker role to allUsers:<br><a href="https://cloud.google.com/functions/docs/securing/managing-access-iam?hl=en#allowing_unauthenticated_http_function_invocation">https://cloud.google.com/functions/docs/securing/managing-access-iam?hl=en#allowing_unauthenticated_htpp_function_invocation</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*kj36uFF8hi2oxakm1p2c2A.png" /><figcaption>Google Cloud — Add permission</figcaption></figure><p>You’ve now successfully set up Firebase Cloud Functions to interact with the OpenAI API, with your API key securely stored in Google Secret Manager.</p><h4>10. Configure your mobile app to call your function</h4><p>Now, the remaining task is to integrate this function into your mobile app.</p><p>Personally, I found using the <a href="https://firebase.google.com/docs/functions/callable?hl=en&amp;gen=2nd#initialize_the_client_sdk">Firebase Functions SDK</a> quite time-efficient — it conveniently manages user authentication against Firebase, endpoint configuration, and more.</p><p>However, if you prefer a more hands-on approach, you can directly call your production URL and manage the configurations yourself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ly3uqE3s8ARqVMPFWrvsLQ.png" /></figure><p>And voilà! Congratulations on accomplishing this setup!</p><p>While this might not be the simplest solution available, it’s straightforward to set up and doesn’t require a separate backend. The entire setup, including implementation in my mobile app, took around 6 hours.</p><p>It’s an investment worth making — protecting your API key from leaks is crucial, and it’s far better to be proactive than to deal with the consequences later.</p><p>This is my first article on Medium, and I would greatly appreciate your feedback! 🙏</p><p>Feel free to leave a comment below or reach out to me directly:</p><ul><li>On <strong>X/Twitter</strong>: <a href="https://twitter.com/VivienMahe">@VivienMahe</a></li><li>On <strong>my website</strong>: <a href="https://vivienmahe.com/">vivienmahe.com</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5c9ea4c1f84" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>