How can I offer the system’s setup experience for my accessories?

Generated on 7/30/2024

1 search

To offer the system’s setup experience for your accessories, you can use the new AccessorySetupKit introduced in iOS 18 and iPadOS 18. Here’s a step-by-step overview of how it works:

  1. Overview: AccessorySetupKit provides a streamlined and privacy-friendly approach to set up and manage accessories with Bluetooth and Wi-Fi. Simply call an API, and the accessory picker will appear with any nearby accessories that your app wants to pair with. The picker displays high-fidelity artwork and friendly names for the accessories, making it easy for users to identify and authenticate them before setup.

  2. Setup Process:

    • API Call: Call the API to show the accessory picker.
    • Accessory Picker: The picker will display nearby accessories based on the discovery rules and assets your app provides. These rules can include Bluetooth services, Wi-Fi SSIDs, or company identifiers.
    • One-Tap Pairing: Users can pair the accessory with your app with just one tap, granting your app both Bluetooth and Wi-Fi access if the accessory supports both.
  3. Configuration:

    • Info.plist Entries: Add entries in your app's Info.plist to support Bluetooth and Wi-Fi under AccessorySetupKit.
    • Discovery Rules: Define the rules for discovering accessories, such as Bluetooth services and Wi-Fi SSIDs.
  4. Managing Accessories:

    • Accessory Page: The newly designed accessory page in Bluetooth and Wi-Fi settings allows users to modify the accessory name, toggle access for paired apps, or remove the accessory from the system.
    • Events Handling: Handle events such as accessoryAdded, accessoryChanged, and accessoryRemoved to manage the accessory lifecycle within your app.
  5. Migration: If your app already manages existing accessories using system access, you can use ASMigrationDisplayItem to migrate these accessories to AccessorySetupKit.

For a detailed walkthrough, you can refer to the session Meet AccessorySetupKit (02:49).

Relevant Sessions

These sessions provide comprehensive information on how to implement and utilize AccessorySetupKit in your app.