Skip to content

Entitlements & Info.plist

Apple’s App Intents framework requires two separate pieces of metadata for most non-trivial intents: entitlements (for capabilities like HealthKit, Calendars, HomeKit) and Info.plist usage descriptions (for human-facing permission prompts).

Axint lets you declare both on the intent itself and emit merge-ready XML fragments with --emit-entitlements and --emit-info-plist.

Declare it

intents/LogWorkout.intent.ts
import { defineIntent, param } from "@axint/compiler/sdk";
export default defineIntent({
name: "LogWorkoutIntent",
title: "Log Workout",
description: "Logs a workout to HealthKit.",
domain: "health",
params: {
activity: param.string("Activity type"),
duration: param.duration("How long the workout lasted"),
},
entitlements: ["com.apple.developer.healthkit"],
infoPlistKeys: [
"NSHealthUpdateUsageDescription",
"NSHealthShareUsageDescription",
],
});

Emit the fragments

Terminal window
axint compile intents/LogWorkout.intent.ts \
--emit-info-plist \
--emit-entitlements

You get two new files next to the Swift:

LogWorkoutIntent.entitlements.fragment.xml
<dict>
<key>com.apple.developer.healthkit</key>
<true/>
</dict>
LogWorkoutIntent.plist.fragment.xml
<dict>
<key>NSHealthUpdateUsageDescription</key>
<string>(TODO: describe why your app needs this)</string>
<key>NSHealthShareUsageDescription</key>
<string>(TODO: describe why your app needs this)</string>
</dict>

Merge these into your Xcode target’s .entitlements and Info.plist files, fill in the usage descriptions, and you’re done.

Validator rules

Two validator rules fire on this surface:

  • AX108 (warning) — entitlement identifier doesn’t match the <reverse-domain>.<capability> pattern.
  • AX109 (warning) — Info.plist key isn’t one of the standard Apple prefixes (NS, UI, CF, etc.).

Both are warnings, not errors — you can suppress them if you have a good reason, but 99% of the time they’re catching a typo.