I'm looking at development of an iOS app that will communicate with Bluetooth classic devices using iOS Supported Bluetooth Profiles
As I understand, this should be possible using the External Accessory framework and should not require participation in the MFi program. From the MFi FAQ:
What types of accessories and technologies are not part of the MFi Program?
Accessories that do not use any of the MFi licensed technology listed above are not part of the MFi Program. For example:
- Accessories that use only standard Bluetooth profiles supported by iOS
So far, so good. The External Accessory Framework doc introduction says (emphasis added):
The External Accessory framework provides support for communicating with external hardware connected to an iOS-based device through the 30-pin dock connector or wirelessly using Bluetooth. Applications that support external accessories must be sure to configure their Info.plist file correctly. Specifically, you must include the UISupportedExternalAccessoryProtocols key to declare the specific hardware protocols your application supports.
Where are the values for the for the "specific hardware protocols" noted above documented? I'm assuming that this is referring to Bluetooth profiles?
FWIW, I've downloaded and attempted to run Apple's EADemo app. It includes the values com.apple.p1 and com.apple.p2 for the UISupportedExternalAccessoryProtocols key. When I run the EADemo app on a 4th gen iPod Touch/iOS8.1.3 it does not find any BT devices. It should find the Jawbone speaker that it is connected to.
To simplify, I've also created a very small sample app to listen for EAAccessoryDidConnectNotification notifications:
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(accessoryDidConnect:) name:EAAccessoryDidConnectNotification object:nil];
[[EAAccessoryManager sharedAccessoryManager] registerForLocalNotifications];
}
- (void) accessoryDidConnect:(NSNotification *)notification {
EAAccessory *connectedAccessory = [[notification userInfo] objectForKey:EAAccessoryKey];
NSLog(@"didConnect: %@", connectedAccessory.name);
}
When I run the code on the iPod Touch, no notifications are received. While the app is running. I've turned the Jawbone speaker off and then on to initiate a connection. (I can confirm that it does connect by looking at Settings->Bluetooth).
I've added the UISupportedExternalAccessoryProtocols key to the app plist and left the values array empty and added com.apple.p1 and com.apple.p2 (as in the EADemo app).
Any ideas on what I'm missing? How can an iOS app be made to communicate with a Bluetooth classic device?