Based in Brazil
// 5 min

Building Delivery Automations Into a Package Tracker With App Intents

ios siri app-intents automation indie-dev

The best app integrations feel like they were always there.


Why I Built Packybara

If you’ve ever tracked packages in Brazil, you know the pain. You’ve got a Correios delivery, two things coming from Shopee, something from AliExpress you forgot about. Each carrier has its own tracking page, its own format, its own way of telling you nothing useful.

My wife Joy and I were both using one of the existing tracking apps. It was fine until it wasn’t — cluttered, ad-heavy, unreliable. I figured I could build something better. A single app that handles all the carriers, with a capybara that tells you what’s happening in a way that’s actually fun to read.

That’s Packybara. Joy uses it on her iPhone. I use it on mine. It does the job.

But I wanted it to do more than just show status when you open the app.


Delivery Automations

The idea is simple: when a package is delivered, the app can trigger whatever you want — send a text, create a reminder, log it somewhere. You set it up once in Shortcuts and forget about it.

The chain is short:

  1. Packybara refreshes tracking data — either manually or via background refresh
  2. The app detects a status transition — from anything to "delivered"
  3. A delivery event is donated — via IntentDonationManager
  4. Shortcuts picks up the trigger — fires whatever automation you built

The typed outputs include package name, tracking code, and carrier. So automations can be specific — “Only notify me for Correios deliveries” or “Log all AliExpress deliveries to a spreadsheet.”


The Technical Bits

The Event Intent

struct PackageDeliveredEvent: AppIntent {
    static var title: LocalizedStringResource = "Package Delivered"

    @Parameter(title: "Package Name")
    var packageName: String

    @Parameter(title: "Tracking Code")
    var trackingCode: String

    @Parameter(title: "Carrier")
    var carrierName: String

    func perform() async throws -> some IntentResult & ReturnsValue<String> & ProvidesDialog {
        let dialog = IntentDialog(stringLiteral: "CHEGOUUU! \(packageName) foi entregue!")
        return .result(value: "\(packageName) delivered via \(carrierName)", dialog: dialog)
    }
}

Nothing fancy. The intent exists so Shortcuts can register it as an event source. The parameters become the typed values that downstream automation steps can use.

The Donation

In PackageStore.refreshTracking(), after the tracking service returns fresh data:

if result.status == "delivered" && pkg.status != "delivered" {
    if let updated = packages.first(where: { $0.id == pkg.id }) {
        PackageDeliveredEvent.donate(package: updated)
    }
}

The key is the transition check: result.status == "delivered" && pkg.status != "delivered". You only donate once, when the status actually changes. Not every time you refresh a delivered package.

Fire and forget. If the donation fails, the tracking still worked.


Why Event Triggers Matter

Package tracking is one of those categories where event-driven automation makes immediate sense. Everyone understands “when my package arrives, do something.”

But the pattern is universal:

  • Finance apps: “When my balance drops below $100, alert me”
  • Health apps: “When I complete a workout, log it to my journal”
  • Travel apps: “When my flight is delayed, text my pickup”

The App Intents framework makes all of this possible with typed, structured events. The OS becomes the automation layer. Your app just needs to donate the right events at the right time.


Where Apple Is Going With This

Apple has been methodically building toward an agentic OS:

iOS 17: App Intents became the unified framework, replacing SiriKit Intents. iOS 18: “Ask Siri” toggle, on-screen awareness, App Shortcuts discovery. WWDC 2026 (expected): Third-party AI Extensions, natural-language Shortcuts creation.

The trajectory is clear. Today, users manually create Shortcuts automations. Soon, they’ll describe what they want in natural language: “When my Shopee package arrives, send me a text.”

For that to work, apps need to expose events as typed intents, include enough context, and donate reliably. Apps that ship this now are training the system.


Try It

If you use Packybara(currently in testflight), here’s how to set up a delivery automation:

  1. Open the Shortcuts app
  2. Tap Automation+
  3. Search for Packybara
  4. Select Package Delivered as the trigger
  5. Add your action: Send Message, Create Reminder, whatever you want
  6. Done. Next delivery, it fires.