Skip to content

About

A tool to add iOS and macOS extensions to Tauri apps. Automates Xcode project configuration via XcodeGen.

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Repository files navigation

tauri-apple-extensions

npm codecov License

Add iOS and macOS extensions to Tauri apps with a single command.

Features

  • Automatic Xcode project configuration via XcodeGen
  • Built-in skeleton templates with TODO markers
  • Plugin-based template system for custom implementations
  • Supports both iOS and macOS platforms
  • Idempotent - safe to re-run

Prerequisites

  • XcodeGen installed (brew install xcodegen)
  • Tauri iOS project initialized (tauri ios init) for iOS extensions
  • For macOS extensions: Tauri macOS Xcode project via @choochmeque/tauri-macos-xcode

Installation

# npm
npm install -D @choochmeque/tauri-apple-extensions

# pnpm
pnpm add -D @choochmeque/tauri-apple-extensions

# yarn
yarn add -D @choochmeque/tauri-apple-extensions

# bun
bun add -D @choochmeque/tauri-apple-extensions

Usage

# Add iOS Share Extension
npx @choochmeque/tauri-apple-extensions ios add share

# Add macOS Share Extension
npx @choochmeque/tauri-apple-extensions macos add share

This creates a Share Extension with a minimal skeleton template. Open the generated Swift file and implement your logic where you see // TODO: comments.

Options

# Use templates from a plugin (plugin must include tauri-apple-extension config)
npx @choochmeque/tauri-apple-extensions ios add share --plugin <plugin-name>

# Use custom templates directory
npx @choochmeque/tauri-apple-extensions ios add share --templates ./path/to/templates

Note: When using --plugin, the plugin's package.json must contain a tauri-apple-extension config. See For Plugin Developers below.

Supported Extensions

Type Description
share Share Extension for receiving shared content

Post-Setup Steps

After running the tool:

  1. Open the Xcode project:
    • iOS: src-tauri/gen/apple/*.xcodeproj
    • macOS: src-tauri/gen/apple-macos/*.xcodeproj
  2. Select your Apple Developer Team for both targets
  3. Enable App Groups capability for both targets
  4. Configure App Groups in Apple Developer Portal

For Plugin Developers

To make your plugin compatible, add to your package.json:

{
  "tauri-apple-extension": {
    "type": "share",
    "templates": {
      "ios": "./templates/ios",
      "macos": "./templates/macos"
    }
  }
}

Plugins can support one or both platforms. If a user runs the command for a platform your plugin doesn't support, they'll receive a clear error message.

Template Variables

Variable Description
{{APP_GROUP_IDENTIFIER}} App Group ID (e.g., group.com.example.app)
{{APP_URL_SCHEME}} URL scheme for deep linking
{{VERSION}} App version from tauri.conf.json
{{BUNDLE_IDENTIFIER}} Extension bundle identifier
{{PRODUCT_NAME}} App product name

Contributing

PRs welcome! Please open an issue first to discuss what you would like to change.

License

MIT

About

A tool to add iOS and macOS extensions to Tauri apps. Automates Xcode project configuration via XcodeGen.

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages