Shmoopi / iOS-System-Services

iOS System Services is a class to gather all available information about a device.
http://www.shmoopi.net/
MIT License
2k stars 365 forks source link

Unable to detect how many accessories are connected to iPhone device #62

Open VamsiKrishna1805 opened 3 years ago

VamsiKrishna1805 commented 3 years ago

Hi @Shmoopi , Can you please help in this issue?

I connected to USB from MacBook and headphones to iPhone 6 contains iOS 12.4.7 version.

I also tested this code with iPhone 8 contains iOS 13.5.1 versions.

always getting 0 for number accessories connected.

EAAccessoryManager *accessoryManager = [EAAccessoryManager sharedAccessoryManager]; // Get the number of accessories connected int numberOfAccessoriesConnected = (int)[accessoryManager.connectedAccessories count]; // Check if there are any connected if (numberOfAccessoriesConnected > 0) { // There are accessories connected return true; } else { // There are no accessories connected return false; }

in SSAccessoryInfo.m file