What should my app do to access the device name property?
Asked on 2024-07-30
1 search
To access the device name property of an accessory in your app, you can use the asaccessory object from the AccessorySetupKit. When an accessory is ready to use, your app will receive an accessoryadded event. By reading the accessory property from this event, you get an asaccessory object that represents the newly set up accessory. This object includes properties such as the display name, which can be changed in settings.
Here is a relevant segment from the session "Meet AccessorySetupKit":
When an accessory is ready to use, the app would get an accessoryadded event. By reading the accessory property from this event, we get an asaccessory object that represents our newly setup dice. Some other events include accessory changed, which is sent when properties of the accessory have changed, such as display name, which can be changed in settings. Accessory removed is sent when the accessory was removed from the system, either by the user or your app. The as accessory class represents a physical accessory. It has the accessory's authorization state, display name Discovery descriptor, and all of its networking interfaces, including a Bluetooth identifier of the CB peripheral and a Wi Fi ssid if it broadcasts a Wi Fi network with the as accessory object. From the accessory added event, we we can use core Bluetooth to connect to the Bluetooth peripheral. We'll create a CB central manager as always, since we declared accessory setup kit support in our info plist, unlike previous versions of iOS, people will not be asked for permission to use Bluetooth. The CB central manager state will only become powered on when your app has paired accessories. In our case, we have our pink dice.
For more details, you can refer to the session Meet AccessorySetupKit (09:40).

Meet the Contact Access Button
Learn about the new Contacts authorization modes and how to improve Contacts access in your app. Discover how to integrate the Contact Access Button into your app to share additional contacts on demand and provide an easier path to Contacts authorization. We’ll also cover Contacts security features and an alternative API to be used if the button isn’t appropriate for your app.

Meet AccessorySetupKit
Elevate your accessory setup experience with AccessorySetupKit. Display a beautiful pairing dialog with an image of your Bluetooth or Wi-Fi accessory — no trip to the Settings app required. Discover how to improve privacy by pairing only your app with an accessory. And learn how you can migrate existing accessories so they can be managed by AccessorySetupKit.

Meet the next generation of CarPlay architecture
Dive into the architecture for the next generation of CarPlay. Learn how your vehicle system works with iPhone to create a single cohesive experience that showcases the best of your car and iPhone. Learn how UI is rendered and composited, and explore ways to configure and customize a special experience for each vehicle model. This session is intended for automakers and system developers interested in the next generation of CarPlay.
