{"id":19775086,"url":"https://github.com/dotintent/flutter-accessorysetup","last_synced_at":"2025-04-30T19:30:29.495Z","repository":{"id":247942964,"uuid":"821276435","full_name":"dotintent/flutter-accessorysetup","owner":"dotintent","description":"A Flutter plugin to use Apple AccessorySetupKit","archived":false,"fork":false,"pushed_at":"2025-02-05T08:06:57.000Z","size":380,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-06T04:07:37.005Z","etag":null,"topics":["accessorykit","accessorysetupkit","flutter","ios"],"latest_commit_sha":null,"homepage":"https://withintent.com","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotintent.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-28T07:27:14.000Z","updated_at":"2025-03-19T13:39:36.000Z","dependencies_parsed_at":"2024-07-11T13:11:03.340Z","dependency_job_id":"a6e12261-4a84-4721-a495-eb37406c0225","html_url":"https://github.com/dotintent/flutter-accessorysetup","commit_stats":null,"previous_names":["dotintent/flutter-accessorysetup"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotintent%2Fflutter-accessorysetup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotintent%2Fflutter-accessorysetup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotintent%2Fflutter-accessorysetup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotintent%2Fflutter-accessorysetup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotintent","download_url":"https://codeload.github.com/dotintent/flutter-accessorysetup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251769175,"owners_count":21640851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accessorykit","accessorysetupkit","flutter","ios"],"created_at":"2024-11-12T05:14:49.935Z","updated_at":"2025-04-30T19:30:29.472Z","avatar_url":"https://github.com/dotintent.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Flutter Accessory Kit\n\n![](.github/flutter-accessorysetup.png)\n\nAt this stage the library supports:\n\n- [x] BLE\n- [x] WiFi\n- [x] Migration\n\n‼️ One important remark: by Apple's design, the library works only with **iOS 18 or above**. ‼️\n\n## 🚇 How to use\n\nInstall the library using the command line:\n\n```sh\nflutter pub get flutter_accessorysetup\n```\n\n### ⚙️ Setup\n\n- For the full details refer [apple docs](https://developer.apple.com/documentation/accessorysetupkit/discovering-and-configuring-accessories)\n- You should add the keys to the [Info.plist](./example/ios/Runner/Info.plist) of the iOS app to make it work.\n  ⚠️ **If you miss the required key the app will crash when you show the picker.** ⚠️\n\n  - ALWAYS: (Bluetooth or WiFi, or both)\n\n  ```xml\n  \u003ckey\u003eNSAccessorySetupKitSupports\u003c/key\u003e\n  \u003carray\u003e\n    \u003cstring\u003eBluetooth\u003c/string\u003e\n    \u003cstring\u003eWiFi\u003c/string\u003e\n  \u003c/array\u003e\n  ```\n\n  - When you use the `ASDiscoveryDescriptor` with `bluetoothServiceUUID`  \n    ⚠️ **The UUID string must be upper-cased here.** ⚠️\n\n  ```xml\n  \u003ckey\u003eNSAccessorySetupBluetoothServices\u003c/key\u003e\n  \u003carray\u003e\n    \u003cstring\u003e149E9E42-33AD-41AD-8665-70D153533EC1\u003c/string\u003e\n  \u003c/array\u003e\n  ```\n\n  - When you use the `ASDiscoveryDescriptor` with `bluetoothNameSubstring`  \n    ⚠️ **Does not work in the iOS 18 Developer beta 2.** ⚠️\n\n  ```xml\n  \u003ckey\u003eNSAccessorySetupBluetoothNames\u003c/key\u003e\n  \u003carray\u003e\n    \u003cstring\u003eDeviceName\u003c/string\u003e\n  \u003c/array\u003e\n  ```\n\n  - There is an option with manufacturer ID that is not covered here.\n\n- Use the `FlutterAccessorySetup` class. See the full code example in the [Example app](./example/lib/main.dart)\n\n```dart\nfinal _accessorySetup = FlutterAccessorySetup();\n\nvoid activate() {\n  _accessorySetup.eventStream.listen((event) {\n        debugPrint('Got event: ${event.eventType}');\n        // handle session events here\n  }));\n  await _accessorySetup.activate();\n  try {\n    _accessorySetup.showPickerForDevice(\n      'My Ble', Assets.images.ble.path, '4013ABDE-11C0-49E7-9939-4B4567C26ADA'\n    );\n  } on PlatformException {\n    debugPrint('Failed to show the picker');\n  }\n}\n\nvoid deactivate() {\n  accessorySetup.dispose();\n  super.deactivate();\n}\n```\n\n---\n\n## ℹ️ What we know\n\n- You app does not need Bluetooth permissions when you use the picker to work with bluetooth devices.\n\n- It is very easy for user to select the device from a picker.\n\n- ⚠️ If you want to have multiple devices of the same type displayed in the picker, each device should advertise a unique name. The picker will show only one device per unique name. If your device exposes 0x1800 service, the device name in that service should be unique too⚠️\n\n- When the user closes the Picker by tapping the cross button, the `showPicker` closure emits an error (ASErrorDomain, code 700). Be prepared.\n\n- ⚠️ When the person picks a BLE accessory, the picker sends an event of type `ASAccessoryEventType.accessoryChanged`. The picker is supposed to sends an event of type `ASAccessoryEventType.accessoryAdded`, but I can't reproduce it at all.⚠️\n\n- If the device has been connected previously, it will be in the `session.accessories` array right after the session is activated.  \n  ⚠️ **This device will not be discoverable by the Setup Picker until the user disconnects it from the settings.** ⚠️\n\n- If the device has been connected by another app already, the picker will show the device as it was decorated by another app -\u003e meaning the image and name will be from that app, not that you provide. To change the decoration the user should add the device to your app.\n\n- When the user selects the device using the picker:\n  - The device will be displayed in the `Accessories` of the mobile App settings at `Settings/Apps/YourApp`.\n  - The device will be displayed in the `My Devices` section at `Settings/Bluetooth`.\n  - The device's info screen will display the image and name you provided to the `ASPickerDisplayItem` during the discovery process (the same that the user saw in the picker).\n\n- When the user deletes the app, the device will be disconnected automatically. It won't be displayed in the `My Devices` section of the `Settings/Bluetooth` screen anymore.\n\n⚠️ The AccessorySetup does not work on the Simulator. ⚠️\n\n---\n\n## 📗 References\n\n- \u003chttps://developer.apple.com/documentation/accessorysetupkit/discovering-and-configuring-accessories\u003e\n- \u003chttps://developer.apple.com/documentation/accessorysetupkit/authorizing-a-bluetooth-accessory-to-share-a-dice-roll\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotintent%2Fflutter-accessorysetup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotintent%2Fflutter-accessorysetup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotintent%2Fflutter-accessorysetup/lists"}