External Accessory

RSS for tag

Communicate with accessories connected to a device by the Apple Lightning connector or through Bluetooth using External Accessory.

Posts under External Accessory tag

78 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

The status of version x.x.x has changed to Invalid Binary
We have developed a software called xxxxxxxxxx, using the "react-native-star-io10" library (version 1.3.0) to communicate with Star Micronic printers. In older versions, we utilized this library solely for local network printer communication. In an unreleased test version, we attempted to add Bluetooth printer connectivity to the project. However, due to prolonged validation and approval processes by Star Micronic, we opted to remove this feature from the current version of the project. Currently, we are facing a major issue: when we remove the Bluetooth permission keys from the Info.plist file and archive the project, upon upload, we encounter the error "The status of version x.x.x has changed to Invalid Binary." However, when we add the Bluetooth permission keys back to the application, archive the file, and upload it, the software ultimately gets rejected during the In Review phase. We are not utilizing Bluetooth in this version of the software and wish to deliver this version to our users. We plan to add the Bluetooth feature in a future release. Please advise on how we can resolve this issue or if there are specific changes needed in our project asap. Thank you for your attention.
0
0
112
6d
Specify WiFi password for ASDiscoveryDescriptor?
Hello, I am looking into the newly announced Accessory Setup Kit and I'd like to replace my manual WiFi connection setup with it, but I cannot find a way how to specify WiFi password when configuring ASDiscoveryDescriptor, only ssid or ssidPrefix can be specified? Is it really not possible to connect to WiFi with password with this new framework? That kind of makes it unusable for my use case :( Since the accessory has password.
6
0
117
1d
UIView can't handle external keyboard shortcuts combined with Command key (UIKeyCommand)
Keyboard shortcuts that use the Command key modifier are not handled properly, and the UIKeyCommand action and pressesBegan and pressesEnded methods are not called at all or are called unreliably. It is easy to reproduce using this snippet: class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let textView = MyTextView() textView.font = UIFont.systemFont(ofSize: 24) textView.text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec efficitur eros vitae dui consectetur molestie. Integer sed massa rutrum, pharetra orci eget, molestie sem. Fusce vestibulum massa nisi, vitae viverra purus condimentum et. Sed nec turpis aliquam, tempus enim sit amet, gravida libero. Praesent scelerisque venenatis nunc, vel convallis nisl auctor vitae. Mauris malesuada tempus pharetra. Nullam ornare venenatis ullamcorper. In viverra feugiat tincidunt. Nullam iaculis urna eu semper rutrum. " textView.isEditable = true textView.translatesAutoresizingMaskIntoConstraints = false view.addSubview(textView) NSLayoutConstraint.activate([ textView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), textView.bottomAnchor.constraint(equalTo: view.bottomAnchor), textView.leadingAnchor.constraint(equalTo: view.leadingAnchor), textView.trailingAnchor.constraint(equalTo: view.trailingAnchor) ]) } } class MyTextView: UITextView { override var keyCommands: [UIKeyCommand]? { [ UIKeyCommand(input: "[", modifierFlags: .command, action: #selector(commandAction(_:))) ] } override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) { print("pressesBegan") super.pressesBegan(presses, with: event) } override func pressesEnded(_ presses: Set<UIPress>, with event: UIPressesEvent?) { print("pressesEnded") super.pressesEnded(presses, with: event) } @objc private func commandAction(_ sender: Any?) { print("commandAction") } } Run the code in a Simulator or on a Device with an external keyboard connected. Observe the console for a string "commandAction" when pressing the combination Command + [ on the keyboard. Result it not predictable, the UIKeyCommand is not called at all, or called in a loop, or sometimes called after change selection in the UITextView. The same with pressesBegan and pressesEnded. Compare results with the change where instead of Command modifier, we use Control modifier eg.: "UIKeyCommand(input: "[", modifierFlags: .command, action: #selector(commandAction(_:))" - now each keyboard shortcut is properly reported to methods. The UIKeyCommand.wantsPriorityOverSystemBehavior property changes nothing. Behavior reproducible in the Simulator and on the Device (iPad) (the issue was confirmed during online WWDC24 Labs) Reported as FB13897415
0
0
152
2w
Increase in Download Time from Sensors to Mobile with Recent IOS Updates
We have observed a significant increase in download time from the sensors to the mobile device after recent OS updates. We are connected to the external sensors via the BLE interface using the following connection parameters(15,15,0,6000) https://mbientlab.com/tutorials/MetaMotionRL.html: example 1.For 1 Meter with duration of 28 Seconds the IOS 17.1 taking 44 secs where as IOS 17.5.1 taking 82 secs . 2..For 1 Meter with duration of 45 Seconds the IOS 17.1 taking 74 secs where as IOS 17.5.1 taking 143 secs . Even with the same connection parameters, download times were considerably lower in iOS 15 and below devices. We are currently using the connection parameters 15, 15, 0, 6000. I have learned from some documents that the minimum connection interval was changed to 20, but when I tried it, the download time increased further. I am seeking assistance on how to achieve the same download times as the older versions. https://mbientlab.com/community/discussion/comment/11852#Comment_11852
2
0
168
3w
Best Practice for Scheduling EASession Input and Output Streams
My company builds an application using the External Accessory framework to communicate with our hardware. We have followed the documentation and example here and use the stream delegate pattern for scheduling the handling of the EASession's InputStream and OutputStream: https://developer.apple.com/library/archive/featuredarticles/ExternalAccessoryPT/Articles/Connecting.html Our application works, however we have had some issues that cause us to doubt our implementation of the Stream handling for our EASession. All the examples I can find for how to set up this RunLoop based implementation for managing and using the streams associated with the EASession seem to use RunLoop.current to schedule the InputStream and OutputStream. What is not clear to me is what thread the processing of these streams is actually getting scheduled upon. We have occasionally observed our app "freezing" when our connected accessory disconnects, which makes me worry that we have our Stream processing on the main thread of the application. We want these streams to be processed on a background thread and never cause problems locking up our main thread or UI. How exactly do we achieve this? If we are indeed supposed to only use RunLoop.current, how can we make sure we're opening the EASession and scheduling its streams on a non-main thread? On what thread will we receive EAAccessoryDidConnect and EAAccessoryDidDisconnect notifications? Is it safe to schedule streams using RunLoop.current from that thread? What about when the app returns from the background, how are we meant to reconnect to an accessory that the iOS device is already connected to? Hopefully someone here can help guide us and shed some light on how to achieve our desired behavior here.
12
0
359
2w
Bluetooth keyboard events in fully immersive Vision Pro app?
I'm writing a Vision Pro app that's fully immersive and rendered using Metal. Occasionally, some users of this app would benefit from being able to use a physical keyboard (or other accessory like a game controller). It seems very straightforward to capture and handle spatial gesture events, but I cannot find an interface that allows the detection, capture, or handling of keyboard events in any of the objects associated with fully immersive metal rendering: CompositorServices, LayerRenderer, and its associated .frame, .drawable, and .drawable.view don't seem to have any accessory awareness. Can you help me handle a keyboard event?
2
0
434
May ’24
App running in background with External accessory background mode enabled doesn't receive sometimes the EAAccessoryDidConnect or the EAAccessoryDidDisconnect notification
Hi there! folks. Hope you are fine We want our two applications to listen to connection and disconnection notifications in the External accessory when we connect a device to USB These application are running in the background and we need to know when the device connects and disconnects from USB. In those cases, we have configured our apps to listen to local notifications as follows: EAAccessoryManager.shared().registerForLocalNotifications() NotificationCenter.default.addObserver(self, selector: #selector(didConnectAccessory(_:)), name: Notification.Name.EAAccessoryDidConnect, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(didDisconnectAccessory(_:)), name: Notification.Name.EAAccessoryDidDisconnect, object: nil) When the apps are running in foreground, everything works correctly. On the other hand, when the apps are running in the background mode and with the external accessory background mode enabled, the disconnection or connection event is not sent to the applications, causing them to not be able to initialize correctly. We attach traces of the two applications running in the background in a connection event through the USB. in The first application the Notification event is received correctly. In The second application the Notification event is NOT received correctly We would like to investigate with you what may be happening. We have opened a case in the feedback assistant (FB13800710) so you can investigate further. We open the case here so that other people can collaborate with us in depth. Thank you so much Looking forward to hearing from your side. All the best! LogsApplication
3
0
329
4w
How to run a background task on keyboard extension to communicate with a MFi device?
I'm working on a app that can communicate, send and receive data from our own MFi scanner. Ideally, this app can receives data and remains communication even when it's in background, but I can only runs a background task for maximum 30 sec. Along with this main app, we also have a keyboard extension as an interface that can publish collected data to other app that user prefers with string format. However, It seems like Apple doesn't allow to implement UIApplication.shared.beginBackgroundTask method in extension class, is there any alternative that worth to try? Also, can I extend app background task time elapsed to at least 30 minutes? If I can get an official response would be great!
1
0
537
Mar ’24
EAWiFiUnconfiguredAccessoryBrowser configureAccessory not showing UI modal up
Hello everyone, I'm trying to configure my WAC device trough an App. This App finds the device without problems using startSearchingForUnconfiguredAccessoriesMatchingPredicate but when I try to use configureAccessory method I get only 3 messages in Xcode and nothing happens. These messages are: 2024-03-14 12:55:56.261969+0000 App[1394:380785] ### WAC: -[EAWiFiUnconfiguredAccessoryBrowserManager configureAccessory:withConfigurationUIOnViewController:]_block_invoke_3:368 Other Region SKU 2024-03-14 12:55:56.266191+0000 App[1394:374248] ### WAC: _notificationCleanup:42 responseFlags: 3 ### WAC: _notificationCleanup:43 responseFlags: 3 For me they don't look like an Error but would be nice if someone could give me some advice on this, I didn't find nothing about it. Thanks in advance!
1
0
377
Mar ’24
Use external camera in background iOS app
Is there a possibility to develop an iOS app that is connected to an external camera connected through lightning or USB-C port and receives video stream. We need to be able to get this video stream even while the app is in the background or if the phone is locked. We could have the camera connected wirelessly through the lightning port. Is there an available library or a sample app featuring such functionalities. Thanks.
1
0
479
Feb ’24
Using External Accessory Framework in iOS App Development with MAUI
Hello, Apple Developer Community, I am currently developing an iOS application using .NET MAUI. In this application, I need to use the ExternalAccessoryFramework to communicate with external devices. However, I couldn't find any information about the compatibility of MAUI and ExternalAccessoryFramework, and I would like to confirm whether this combination is possible. Can an iOS app developed with MAUI use the ExternalAccessoryFramework? If so, could you provide any guidelines or reference materials about its implementation? I would greatly appreciate it if you could share your knowledge and experience. Thank you in advance.
1
0
442
Feb ’24
How to make the device communicate with the iPhone 15 APP using the USB-C interface?
Before iPhone 15, the lighting interfaces required communication with external devices through mfi authentication,But there is no evidence to suggest that the USB-C interface needs to add an MFi authentication chip for authentication detection. Is there a way to use USB-C to detect external devices and communicate with each other in the app now, so that I can create my app and communicate with hardware devices
1
1
598
Jan ’24
Wired data transfer between an app on two iOS/iPadOS devices--Possible or pipe dream?
If two iOS/iPadOS devices have your app opened, is it possible to have the apps send data to each other over a wired connection? E.g. If two iPhone 15s are connected by USB-C, can I get my app in iPhone A to send data to iPhone B and vice-versa? I've been looking around for quite a while now and at this point I just want to know if it's technically feasible.
5
0
739
Feb ’24
AirDrop iOS17
Hi all, hope everyone is well. I'm seeking clarification regarding AirDrop functionality in regards to apps. For example, can the new AirDrop function within iOS17, whereby putting two iPhones together transfers user contact details to one another be utilised by an app? If not, please could I have clarification what bluetooth functionality within iPhone's an App may be able to utilise and could an app connect to AirDrop API's in any way? If the new AirDrop feature is not currently able to be utilised by apps, is this likely to change in the future with upcoming iOS updates or is it a set in stone thing? Apologies, I don't have the deepest understanding of this topic and any help is really appreciated, thank you.
0
0
508
Jan ’24
EAWiFiUnconfiguredAccessoryBrowser not being able to detect device the OS is able to detect
Hey there 👋, My team and me have implemented support for WAC devices in our App using EAWiFiUnconfiguredAccessoryBrowser. When the device we want to support is factory reset we are able to find it as well as the OS is able to. The device has a "setup wifi" button, which starts the WAC process, and iOS (as well as MacOS) are able to find it. Unfortunately we are not able to find it in that case using EAWiFiUnconfiguredAccessoryBrowser.. I could not find any restrictions on it in the documentation, any glues why we are not able to detect it in that situation? I isolated the problem in a sample and used the following implementation to test this: import Foundation import ExternalAccessory import os import Combine class WACWatcher: NSObject { private let browser: EAWiFiUnconfiguredAccessoryBrowser private let logger = Logger(subsystem: "WACWatcher", category: "networking") @Published var accessories: [EAWiFiUnconfiguredAccessory] = [] override init() { self.browser = EAWiFiUnconfiguredAccessoryBrowser() super.init() self.browser.delegate = self } func start() { browser.startSearchingForUnconfiguredAccessories(matching: nil) } func stop() { browser.stopSearchingForUnconfiguredAccessories() } } extension WACWatcher: EAWiFiUnconfiguredAccessoryBrowserDelegate { func accessoryBrowser( _ browser: EAWiFiUnconfiguredAccessoryBrowser, didUpdate state: EAWiFiUnconfiguredAccessoryBrowserState ) { switch state { case .wiFiUnavailable: logger.debug("WAC Browser state changed to wifiUnavailable") break case .stopped: logger.debug("WAC Browser state changed to stopped") break case .searching: logger.debug("WAC Browser state changed to searching") break case .configuring: logger.debug("WAC Browser state changed to configuring") break } } func accessoryBrowser( _ browser: EAWiFiUnconfiguredAccessoryBrowser, didFindUnconfiguredAccessories accessories: Set<EAWiFiUnconfiguredAccessory> ) { logger.info("WACWatcher found accessories: \(accessories)") self.accessories.append(contentsOf: accessories) } func accessoryBrowser( _ browser: EAWiFiUnconfiguredAccessoryBrowser, didRemoveUnconfiguredAccessories accessories: Set<EAWiFiUnconfiguredAccessory> ) { logger.info("WACWatcher removed accessories: \(accessories)") self.accessories = accessories.filter({ accessory in accessories.contains(where: { $0.name == accessory.name }) }) } func accessoryBrowser( _ browser: EAWiFiUnconfiguredAccessoryBrowser, didFinishConfiguringAccessory accessory: EAWiFiUnconfiguredAccessory, with status: EAWiFiUnconfiguredAccessoryConfigurationStatus ) {} } This WACWatcher gets used in a ViewModel and a view having a start stop button and a list showing the device name. If you'd need to see it, I can zip it and attach it to this post.
1
0
423
Dec ’23