Bluetooth HID Device & iOS textFields

前端 未结 2 1880
借酒劲吻你
借酒劲吻你 2020-12-18 17:03

We are using a BT device, which acts as a keyboard, to talk to the iPad. We want this bluetooth device to talk to 1 field in our app. (Which is on it\'s own view) All other

2条回答
  •  隐瞒了意图╮
    2020-12-18 17:41

    Phil,

    I'm not sure if you've discovered the External Accessory Framework but that is probably your best bet to get what you're after and have an app that will be accepted in the store. I'm currently working through some similar issues and I think this is how I'll be able to detect which of our supported devices the user is using.

    https://developer.apple.com/library/ios/#documentation/ExternalAccessory/Reference/ExternalAccessoryFrameworkReference/_index.html

    EAAccessoryManager looks like it may give you back a list of attached devices. That's exactly what I'm looking for. It should allow me to then take the correct path to connect to the devices.

    This may give you back what you're interested in...

    #import 
    
    - (void)_getAttachedDevices;
    {
        EAAccessoryManager* accessoryManager = [EAAccessoryManager sharedAccessoryManager];
        if (accessoryManager)
        {
            NSArray* connectedAccessories = [accessoryManager connectedAccessories];
            NSLog(@"ConnectedAccessories = %@", connectedAccessories);
        }
    }
    

    Hope this helps.

提交回复
热议问题