<?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: appgenie</title>
    <description>The latest articles on DEV Community by appgenie (@appgenie_aedb1276a9658ec2).</description>
    <link>https://dev.to/appgenie_aedb1276a9658ec2</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%2F4267033%2Fd80a8873-20fc-4791-abc2-79a76e037d0e.png</url>
      <title>DEV Community: appgenie</title>
      <link>https://dev.to/appgenie_aedb1276a9658ec2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/appgenie_aedb1276a9658ec2"/>
    <language>en</language>
    <item>
      <title>How I log bank SMS expenses on iPhone (when apps can't read SMS)</title>
      <dc:creator>appgenie</dc:creator>
      <pubDate>Thu, 26 Nov 2026 13:36:25 +0000</pubDate>
      <link>https://dev.to/appgenie_aedb1276a9658ec2/how-i-log-bank-sms-expenses-on-iphone-when-apps-cant-read-sms-4jgo</link>
      <guid>https://dev.to/appgenie_aedb1276a9658ec2/how-i-log-bank-sms-expenses-on-iphone-when-apps-cant-read-sms-4jgo</guid>
      <description>&lt;p&gt;iPhone apps can't read your SMS. There's no permission for it, no API, nothing. That's great for privacy, and a real problem if you're building an expense tracker for India or the UAE, where every UPI payment, card swipe and EMI debit arrives as a bank text.&lt;/p&gt;

&lt;p&gt;Android trackers solved this years ago by reading the SMS inbox. On iOS I needed a different route for &lt;a href="https://paypilot.appgenie.in/" rel="noopener noreferrer"&gt;PayPilot&lt;/a&gt;, my personal finance app. This post explains the approach that works today, its limits, and what I learned building it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The only door Apple leaves open: Shortcuts automations
&lt;/h2&gt;

&lt;p&gt;Since iOS 17, the Shortcuts app can run a &lt;strong&gt;personal automation&lt;/strong&gt; when a message arrives, without asking each time. The user sets it up once:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Trigger:&lt;/strong&gt; "When I receive a message" where &lt;em&gt;Message contains&lt;/em&gt; a word.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Action:&lt;/strong&gt; your app's action, receiving the message &lt;strong&gt;Content&lt;/strong&gt; (and optionally the &lt;strong&gt;Sender&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confirm Before Run:&lt;/strong&gt; off, so it runs silently.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Your app never touches the inbox. iOS hands it only the texts that match the user's own filter. For a finance app that's a feature, not a workaround: users can see exactly what you receive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exposing an action to Shortcuts
&lt;/h2&gt;

&lt;p&gt;Third-party actions show up in Shortcuts through &lt;strong&gt;App Intents&lt;/strong&gt;. A minimal version looks roughly like this:&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;import&lt;/span&gt; &lt;span class="nc"&gt;AppIntents&lt;/span&gt;

&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="nc"&gt;LogBankMessage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AppIntent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;LocalizedStringResource&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Log bank message"&lt;/span&gt;
    &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;openAppWhenRun&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;

    &lt;span class="nd"&gt;@Parameter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Message"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;
    &lt;span class="nd"&gt;@Parameter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Sender"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;sender&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="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;perform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;throws&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;some&lt;/span&gt; &lt;span class="nc"&gt;IntentResult&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;expense&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;BankSMSParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&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="nc"&gt;ExpenseStore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;expense&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="c1"&gt;// Not a payment? Drop it. Nothing is stored.&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;result&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;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep &lt;code&gt;openAppWhenRun&lt;/code&gt; false so the automation runs in the background, and keep &lt;code&gt;perform()&lt;/code&gt; fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  One trigger word to catch most payments
&lt;/h2&gt;

&lt;p&gt;A message automation filters on &lt;strong&gt;one&lt;/strong&gt; word. The trick that made this usable: use &lt;strong&gt;&lt;code&gt;ited&lt;/code&gt;&lt;/strong&gt;. It's the shared part of deb*&lt;em&gt;ited&lt;/em&gt;&lt;em&gt;, cred&lt;/em&gt;&lt;em&gt;ited&lt;/em&gt;* and depos*&lt;em&gt;ited&lt;/em&gt;*, so a single automation catches money going out and coming in from almost every bank in India and the UAE.&lt;/p&gt;

&lt;p&gt;It also matches words like "limited" and "invited". That's fine: the parser runs on the phone, sees there's no amount or account, and drops the text. A few banks write "spent" or "UPI debit:" instead, so those users add one more automation with that word.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parsing on the device
&lt;/h2&gt;

&lt;p&gt;Bank SMS formats vary a lot, but most contain the same pieces: a currency and amount, a direction, an account or card ending, and a payee. A simplified version of the first pass:&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="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="cp"&gt;#/(?:INR|Rs\.?|₹|AED)\s*([\d,]+(?:\.\d{1,2})?)/#&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;isDebit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="cp"&gt;#/debited|spent|withdrawn|debit:/#&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;isCredit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="cp"&gt;#/credited|received|deposited|refund/#&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="cp"&gt;#/(?:A\/c|card)\s*(?:no\.?|ending)?\s*[Xx*]*(\d{3,4})/#&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Real messages need more than this (merchant cleanup, duplicate alerts for the same payment, multi-currency cards), but everything stays on the phone. Two rules I'd recommend to anyone doing this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Discard one-time passwords immediately.&lt;/strong&gt; Never store or log them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep only the result&lt;/strong&gt; (amount, merchant, date, last 4 digits), not the message text.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Apple Pay: a second automation
&lt;/h2&gt;

&lt;p&gt;Wallet has its own trigger, "When any card is tapped", which passes &lt;strong&gt;Amount&lt;/strong&gt;, &lt;strong&gt;Merchant&lt;/strong&gt; and &lt;strong&gt;Card&lt;/strong&gt;. A second App Intent receives those, so in-store Apple Pay taps are logged even when the bank's SMS is slow. Apple Pay inside apps and websites doesn't fire this trigger, but the bank SMS still covers it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trade-offs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Setup takes about two minutes per automation.&lt;/strong&gt; Clear step-by-step screenshots matter more than any code. I wrote &lt;a href="https://paypilot.appgenie.in/auto-capture" rel="noopener noreferrer"&gt;a full guide&lt;/a&gt; and a page explaining &lt;a href="https://paypilot.appgenie.in/sms-expense-tracker-iphone" rel="noopener noreferrer"&gt;how SMS expense tracking works on iPhone&lt;/a&gt;, with an in-browser SMS checker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One keyword per automation&lt;/strong&gt;, so unusual bank wording needs another automation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;iOS 17 or later.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In return you get automatic expense logging on iPhone with no bank login, no server reading messages, and a privacy story users can verify themselves.&lt;/p&gt;

&lt;p&gt;If you're building something similar, I'm happy to compare notes in the comments. And if you track money in India or the UAE, you can try it in &lt;a href="https://apps.apple.com/us/app/paypilot-expense-tracker/id6818137668" rel="noopener noreferrer"&gt;PayPilot&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Naveen, an indie developer in Dubai building apps under AppGenie.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>showdev</category>
      <category>privacy</category>
    </item>
  </channel>
</rss>
