<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Satechs LLC</title>
    <description>The latest articles on DEV Community by Satechs LLC (@satechss).</description>
    <link>https://dev.to/satechss</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4200317%2Fd4a208ed-f200-4647-adec-8d8839598a06.png</url>
      <title>DEV Community: Satechs LLC</title>
      <link>https://dev.to/satechss</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/satechss"/>
    <language>en</language>
    <item>
      <title>Selling a Flutter app on Google Play without a backend: trial, lifetime, subscription and an upgrade</title>
      <dc:creator>Satechs LLC</dc:creator>
      <pubDate>Mon, 26 Oct 2026 09:57:29 +0000</pubDate>
      <link>https://dev.to/satechss/selling-a-flutter-app-on-google-play-without-a-backend-trial-lifetime-subscription-and-an-upgrade-2di4</link>
      <guid>https://dev.to/satechss/selling-a-flutter-app-on-google-play-without-a-backend-trial-lifetime-subscription-and-an-upgrade-2di4</guid>
      <description>&lt;p&gt;&lt;a href="https://shiftary.app" rel="noopener noreferrer"&gt;Shiftary&lt;/a&gt; is a shift planner for Android, built in Flutter. It works offline with no account, so when it came to charging for it I had one constraint: &lt;strong&gt;no server in the purchase path.&lt;/strong&gt; If my backend is down, nobody should lose access to their rota.&lt;/p&gt;

&lt;p&gt;The model ended up as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a &lt;strong&gt;14-day trial&lt;/strong&gt; of everything, no card&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shiftary Lifetime&lt;/strong&gt;: one-time, $19.99&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shiftary Cloud&lt;/strong&gt;: yearly subscription, $9.99, adds cloud backup and sync&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lifetime upgrade&lt;/strong&gt;: $9.99, only offered to Cloud subscribers, so they never pay full price twice&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's how each piece works with the &lt;a href="https://pub.dev/packages/in_app_purchase" rel="noopener noreferrer"&gt;&lt;code&gt;in_app_purchase&lt;/code&gt;&lt;/a&gt; plugin, and the two places where Google Play doesn't give the app what you'd expect.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trial: earliest date wins
&lt;/h2&gt;

&lt;p&gt;The trial runs on the phone's clock from first launch. Nothing waits for the network, so the calendar opens instantly even in a hospital basement.&lt;/p&gt;

&lt;p&gt;The start date is stored in two places: &lt;code&gt;SharedPreferences&lt;/code&gt;, and inside the user's own data (the same snapshot that goes into backup files and cloud sync). On every launch the app takes the &lt;strong&gt;earliest&lt;/strong&gt; of the two:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;saved&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;tryParse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prefs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_kTrialStart&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;inData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;appState&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;trialStartedAt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;candidates&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="n"&gt;saved&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="n"&gt;inData&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;_trialStart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;candidates&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;isEmpty&lt;/span&gt;
    &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;_now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;candidates&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;isBefore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So restoring a backup or signing in to sync brings the original start date back with your data. A date can only ever move earlier, which can only shorten a trial.&lt;/p&gt;

&lt;p&gt;Is it uncrackable? No. Clearing app data and never restoring gets you a new trial. But that's also a person starting from an empty calendar, and I'm fine with that trade.&lt;/p&gt;

&lt;p&gt;When the trial ends without a plan, the app doesn't lock you out. It becomes view-only: your shifts are still there, and you can still export a backup. Holding someone's rota hostage is how you earn the 1-star review.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ownership: ask Play, cache the answer
&lt;/h2&gt;

&lt;p&gt;For "does this person own Lifetime or Cloud?", Play is the source of truth. On Android you can query past purchases directly through the platform addition:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;android&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="n"&gt;_iap&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getPlatformAddition&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;InAppPurchaseAndroidPlatformAddition&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;android&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;queryPastPurchases&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;pastPurchases&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;status&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;PurchaseStatus&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;purchased&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
      &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;status&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;PurchaseStatus&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;restored&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;billingClientPurchase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// w.orderId, w.purchaseTime, w.isAutoRenewing …&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;pendingCompletePurchase&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_iap&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;completePurchase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details worth copying:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Acknowledge anything you find unacknowledged.&lt;/strong&gt; Play refunds purchases that aren't acknowledged within three days. If the app was killed between the payment and &lt;code&gt;completePurchase&lt;/code&gt;, the next launch fixes it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache what you own&lt;/strong&gt; in &lt;code&gt;SharedPreferences&lt;/code&gt; and refresh in the background. Offline, the app trusts the cache; online, Play corrects it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Play only returns subscriptions that are currently active, so access never depends on a date I worked out myself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotcha 1: Play doesn't give the app the renewal date
&lt;/h2&gt;

&lt;p&gt;I wanted Settings to say "Renews on 12 March 2027", or "Ends on…" if you've cancelled. Without a server calling the Play Developer API, the app gets &lt;code&gt;purchaseTime&lt;/code&gt;, &lt;code&gt;isAutoRenewing&lt;/code&gt; and &lt;code&gt;orderId&lt;/code&gt;. No expiry.&lt;/p&gt;

&lt;p&gt;The order ID helps. Renewals of a subscription use the original order ID plus &lt;code&gt;..0&lt;/code&gt;, &lt;code&gt;..1&lt;/code&gt;, and so on. So the number of years paid is the renewal count plus one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt; &lt;span class="nf"&gt;cloudPeriodEnd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;DateTime&lt;/span&gt; &lt;span class="n"&gt;purchasedAt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;orderId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;RegExp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sx"&gt;r'\.\.(\d+)$'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;firstMatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;orderId&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;years&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;DateTime&lt;/span&gt; &lt;span class="n"&gt;plus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;purchasedAt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;year&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;purchasedAt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;month&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;purchasedAt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;purchasedAt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;hour&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;purchasedAt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;minute&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;years&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// A paid year can't end more than a year from now.&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;isAfter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;Duration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;days:&lt;/span&gt; &lt;span class="mi"&gt;367&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;plus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final line is a guard: if the arithmetic ever gives a date more than a year away, the app shows a year after &lt;code&gt;purchaseTime&lt;/code&gt; instead. It's a label, not access control, so a rare wrong day is acceptable. A wrong &lt;em&gt;access&lt;/em&gt; decision wouldn't be, which is why that comes from Play.&lt;/p&gt;

&lt;p&gt;Test it with license testers: their yearly subscriptions renew every 30 minutes, so you see &lt;code&gt;..0&lt;/code&gt;, &lt;code&gt;..1&lt;/code&gt;, &lt;code&gt;..2&lt;/code&gt; within an afternoon.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotcha 2: you can't discount a one-time product per user
&lt;/h2&gt;

&lt;p&gt;Cloud subscribers who later decide they want Lifetime shouldn't pay $19.99 on top of what they've paid. Play has no "discount this one-time product for people who own X". So the upgrade is a &lt;strong&gt;separate one-time product&lt;/strong&gt; (&lt;code&gt;shiftary_lifetime_upgrade&lt;/code&gt;, $9.99), and the app decides who sees it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;StoreProduct&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="kd"&gt;get&lt;/span&gt; &lt;span class="n"&gt;lifetimeOffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;hasCloud&lt;/span&gt;
    &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;_products&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;kLifetimeUpgradeId&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="n"&gt;lifetimeProduct&lt;/span&gt;
    &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;lifetimeProduct&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Owning either product counts as Lifetime. Someone could, in theory, find the upgrade product another way. In practice it's only shown to subscribers, and the worst case is a $10 discount. Again, a trade I'm fine with.&lt;/p&gt;

&lt;p&gt;And it can be bought straight away. A subscriber who decides on day three that they want Lifetime doesn't have to wait out the year. The plans screen also has a &lt;strong&gt;Manage Cloud subscription&lt;/strong&gt; button that deep-links to the subscription in Play, so cancelling is one tap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;kManageCloudUrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'https://play.google.com/store/account/subscriptions'&lt;/span&gt;
    &lt;span class="s"&gt;'?sku=shiftary_cloud_yearly&amp;amp;package=app.shiftary'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What I'd do again
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep the server out of the purchase path.&lt;/strong&gt; Play already knows who paid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make the safe failure the default.&lt;/strong&gt; Offline means "trust the cache", trial-over means "view-only", unknown expiry means "a year after purchase".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Put the trial date inside the user's data&lt;/strong&gt;, so it follows them through backups and sync, earliest date wins.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Shiftary is on &lt;a href="https://play.google.com/store/apps/details?id=app.shiftary" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;, more at &lt;a href="https://shiftary.app" rel="noopener noreferrer"&gt;shiftary.app&lt;/a&gt;. If you've shipped Play Billing in Flutter, I'd love to hear what tripped you up.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>android</category>
      <category>googleplay</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Making a reminder actually ring: lessons from Android and iPhone</title>
      <dc:creator>Satechs LLC</dc:creator>
      <pubDate>Thu, 22 Oct 2026 11:13:48 +0000</pubDate>
      <link>https://dev.to/satechss/making-a-reminder-actually-ring-lessons-from-android-and-iphone-32da</link>
      <guid>https://dev.to/satechss/making-a-reminder-actually-ring-lessons-from-android-and-iphone-32da</guid>
      <description>&lt;p&gt;I built a reminder app called &lt;a href="https://alarvo.app" rel="noopener noreferrer"&gt;Alarvo&lt;/a&gt; where the important reminders behave like an alarm clock: full screen, through Do Not Disturb and Silent mode, ringing until you tap Done. I thought the hard part would be the alarm screen. It wasn't. The hard part was making sure the alarm fires at all.&lt;/p&gt;

&lt;p&gt;Alarvo runs on Android and iPhone, and the two platforms could hardly be more different here. Here's what I learned, in case you're building anything time-critical on either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Android: the alarm is easy, firing it is not
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Pick the right AlarmManager API
&lt;/h3&gt;

&lt;p&gt;Most reminder apps schedule with &lt;code&gt;setExactAndAllowWhileIdle&lt;/code&gt;. It looks right: exact, and allowed while idle. In practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Doze can still defer it.&lt;/li&gt;
&lt;li&gt;While the device is idle, it's rate-limited to roughly once every 9 minutes per app.&lt;/li&gt;
&lt;li&gt;The user can't see it, so when it fails, nobody knows why.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;setAlarmClock&lt;/code&gt; is different. The platform treats it as a real, user-facing alarm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;info&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AlarmManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AlarmClockInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;triggerAtMillis&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;showIntent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;alarmManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setAlarmClock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;firePendingIntent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's exempt from Doze and App Standby buckets, and OEM battery managers are least likely to touch it. As a bonus, it puts the alarm icon in the status bar. That icon is a free, always-on signal to the user that the app is armed.&lt;/p&gt;

&lt;p&gt;The catch: &lt;code&gt;setAlarmClock&lt;/code&gt; is for things the user genuinely asked to be woken for. I use it only for &lt;strong&gt;Critical&lt;/strong&gt; reminders and for tasks the user explicitly set to ring. Quieter reminders go through &lt;code&gt;setExactAndAllowWhileIdle&lt;/code&gt; or plain notifications. Using the strong API for everything is abusing the privilege, and invites the platform (and Play review) to take it away.&lt;/p&gt;

&lt;p&gt;On Android 12+, check before you schedule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;canSchedule&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;VERSION&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SDK_INT&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nc"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;VERSION_CODES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;S&lt;/span&gt; &lt;span class="p"&gt;||&lt;/span&gt; &lt;span class="n"&gt;alarmManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;canScheduleExactAlarms&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;setAlarmClock&lt;/code&gt; throws a &lt;code&gt;SecurityException&lt;/code&gt; without the permission. Catch it and tell the user, instead of crashing or silently dropping their reminder.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Alarms disappear more often than you think
&lt;/h3&gt;

&lt;p&gt;Scheduled alarms don't survive several everyday events. Most apps handle &lt;code&gt;BOOT_COMPLETED&lt;/code&gt; and stop there. My receiver also listens for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;MY_PACKAGE_REPLACED&lt;/code&gt;&lt;/strong&gt;: an app update clears your alarms. Without this, every release silently disarms every reminder for every user until they next open the app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;LOCKED_BOOT_COMPLETED&lt;/code&gt;&lt;/strong&gt;: fires before the user unlocks a direct-boot device, much earlier than &lt;code&gt;BOOT_COMPLETED&lt;/code&gt;. Handling both is harmless if rescheduling is idempotent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;TIMEZONE_CHANGED&lt;/code&gt; and &lt;code&gt;TIME_SET&lt;/code&gt;&lt;/strong&gt;: if you store wall-clock times ("8:00 PM"), flying somewhere changes when that actually is. Recompute.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Ringing through Do Not Disturb
&lt;/h3&gt;

&lt;p&gt;For the alarm itself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Play the sound with &lt;code&gt;AudioAttributes.USAGE_ALARM&lt;/code&gt;, so it uses the alarm stream and cuts through silent mode. Use &lt;code&gt;USAGE_NOTIFICATION&lt;/code&gt; for quieter levels; the alarm stream stays audible when the user has deliberately silenced notifications, and only the reminders that earned it should use it.&lt;/li&gt;
&lt;li&gt;Show it with a full-screen intent over the lock screen. On Android 14+, &lt;code&gt;USE_FULL_SCREEN_INTENT&lt;/code&gt; is only granted at install to apps whose core function is alarms or calls, and the user can revoke it. Check &lt;code&gt;NotificationManager.canUseFullScreenIntent()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Run the ringing in a foreground service, so it isn't killed mid-alarm.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. The part no API fixes: phone makers
&lt;/h3&gt;

&lt;p&gt;Even with all of the above, OEM battery managers can kill your app: Samsung's "sleeping apps", Xiaomi's Autostart, and others. None of them tell the user they've done it.&lt;/p&gt;

&lt;p&gt;You can't fix this in code, so I made it visible instead. Alarvo has a reliability screen that checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;exact-alarm permission&lt;/li&gt;
&lt;li&gt;notifications enabled&lt;/li&gt;
&lt;li&gt;full-screen intent allowed&lt;/li&gt;
&lt;li&gt;Do Not Disturb access (&lt;code&gt;isNotificationPolicyAccessGranted&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;battery optimisation (&lt;code&gt;PowerManager.isIgnoringBatteryOptimizations&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;the maker-specific settings, with step-by-step instructions for each brand&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Prove it: ship a test alarm
&lt;/h3&gt;

&lt;p&gt;The last piece is a &lt;strong&gt;test alarm&lt;/strong&gt;: the user locks the phone, puts it down, and 15 seconds later a real alarm rings, through exactly the same path real reminders use (same scheduler, same receiver, same service). If anything in the chain is broken on that particular phone, they find out now and not at 3 AM.&lt;/p&gt;

&lt;p&gt;I think every app that promises to wake you should ship one.&lt;/p&gt;

&lt;h2&gt;
  
  
  iPhone: AlarmKit changes the rules
&lt;/h2&gt;

&lt;p&gt;On iPhone, the problem used to be the opposite. Background execution is tightly controlled, and a third-party app could only remind you with a notification: a short sound that Silent mode and Focus would happily mute. There was no way to build a real alarm.&lt;/p&gt;

&lt;p&gt;AlarmKit (iOS 26) fixes that. Your app asks once for permission:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="kt"&gt;AlarmManager&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;requestAuthorization&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and then schedules alarms that the system itself owns and rings: full screen on the lock screen, through Silent mode and Focus, whether or not your app is running.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="kt"&gt;AlarmManager&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;schedule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;configuration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;configuration&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The buttons on the alarm are App Intents. I pass a &lt;code&gt;stopIntent&lt;/code&gt; for &lt;strong&gt;Done&lt;/strong&gt; and a &lt;code&gt;secondaryIntent&lt;/code&gt; for &lt;strong&gt;Snooze&lt;/strong&gt;, so the app learns which one you pressed and can mark the reminder done, or bring it back, even if it was never opened.&lt;/p&gt;

&lt;p&gt;What you don't get is the Android-style escalation ladder: the system rings the alarm, and you don't control it once it's going. That's a fair trade. Because the OS owns the alarm, there's no battery manager to fight and no reliability screen needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The app
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://alarvo.app" rel="noopener noreferrer"&gt;Alarvo&lt;/a&gt; has three reminder levels (quiet notification, sound, or full alarm), an AI planner that turns "gym at 6, meds at 9" into reminders you check before saving, repeats like "3 days after I last did it," and one account that syncs across Android and iPhone.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://alarvo.app" rel="noopener noreferrer"&gt;https://alarvo.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Google Play: &lt;a href="https://play.google.com/store/apps/details?id=app.alarvo" rel="noopener noreferrer"&gt;https://play.google.com/store/apps/details?id=app.alarvo&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you've fought background limits on either platform, I'd love to hear what worked for you, especially on Android brands I haven't tested.&lt;/p&gt;

</description>
      <category>android</category>
      <category>mobile</category>
      <category>showdev</category>
      <category>ios</category>
    </item>
  </channel>
</rss>
