Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
VamsiKrishna1805 opened this issue Mar 24, 2021 · 0 comments

Comments

@VamsiKrishna1805
Copy link

VamsiKrishna1805 commented Mar 24, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant