【问题标题】:Not getting EA notification with bluetooth没有通过蓝牙收到 EA 通知
【发布时间】:2013-05-06 21:08:25
【问题描述】:

通过 USB 连接到外部设备(兼容 MFi)时,我能够收到 EA 通知,但不能通过蓝牙。与文档的建议相反,为什么没有针对蓝牙连接触发 EA 通知?

【问题讨论】:

    标签: ios external-accessory


    【解决方案1】:

    1) 您是否在 InfoPlist 中正确设置了协议字符串?
    2)您是否在蓝牙设备中正确设置了协议字符串?
    3)您是否注册了传入连接事件?像这样:

    -(void) <someMethod> {     
        [[EAAccessoryManager sharedAccessoryManager] registerForLocalNotifications];
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(accessoryConnected:)
                                                     name:EAAccessoryDidConnectNotification
                                                   object:nil];
    }
    
    -(void)accessoryConnected: (NSNotification *)notification {
        EAAccessory *accessory = [[notification userInfo] objectForKey:EAAccessoryKey];
        NSLog(@"%@ connected", accessory.name);
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-08-17
      • 2011-07-20
      • 2016-12-26
      • 2021-09-22
      • 2015-04-21
      • 2014-10-07
      • 1970-01-01
      相关资源
      最近更新 更多