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;
}
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