【问题标题】:Connection between devices via blue tooth iOS通过蓝牙iOS设备之间的连接
【发布时间】:2015-09-14 07:37:46
【问题描述】:

我正在处理iOS Application,我想在其中列出蓝牙设备名称并连接到其中任何一个并传输数据(消息)。

现在我正在使用MultiPeerConnectivityFramework,它使用 MCBrowserViewController 来发现附近的设备,但不幸的是,我没有在 MCBrowserViewController 中获得任何设备名称。这是我的代码

-(void)setupPeerAndSessionWithDisplayName:(NSString *)_displayName{

self.peerID = [[MCPeerID alloc] initWithDisplayName:_displayName];
self.session = [[MCSession alloc] initWithPeer:self.peerID];
self.session.delegate = self;

}

-(void)setupMCBrowser{

self.browser = [[MCBrowserViewController alloc] initWithServiceType:@"chat-files" session:self.session];

}

【问题讨论】:

    标签: ios bluetooth core-bluetooth multipeer-connectivity


    【解决方案1】:

    MultipeerConnectivity 是 Apple 特定的框架,遗憾的是不适用于 Android 设备。

    据我所知,使用蓝牙进行这种跨平台连接是不可能的。特别是如果您想使用不在前台的应用程序来执行此操作。

    【讨论】:

      猜你喜欢
      • 2016-05-06
      • 2020-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-20
      • 1970-01-01
      • 2022-08-10
      • 2016-11-28
      相关资源
      最近更新 更多