使用iBeacon或类似技术传输数据 [英] Transmitting data using iBeacon or similar technology

查看:464
本文介绍了使用iBeacon或类似技术传输数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个应用程序,使设备能意识到彼此的范围内时。要做到这一点,我使用iBeacon。

I am working on an app that allows devices to become aware of each other when in range. To do this i am using iBeacon.

在发展的下一个阶段,我想能够发送一个肯定或任何范围内的设备之间没有字符串 - 让任何人谁是连接到任何其他iBeacon可以交流这些固定的消息

In the next stage of development i want to be able to send a yes or no string between any of the devices in range - so anyone who is connected to any other iBeacon can communicate these fixed messages

正如iBeacon不能支持数据的发送 - 什么是促进这一目标的最佳方法。 2.方法我目前所面对的是通过蓝牙或Web服务。

As iBeacon cannot support sending of data - what is the best approach to facilitate this. The 2 approaches i have at the moment are via bluetooth or a web service.

请会有人提供了一些建议上什么是最好的办法。

Please could someone provide some advise on to what is the best approach.

推荐答案

两种方法都可以工作,但Web服务有真正的优势:

Either approach can work, but a web service has real advantages:

  1. 连接到蓝牙服务需要用户权限,网络服务不。

  1. Connecting to a bluetooth service requires user permission, a web service does not.

如果您的应用程序没有在前台运行时,iBeacon监视API可以把它发射到后台约5秒钟。在此期间,你可以调用Web服务。但对于蓝牙连接的后台支持在iOS中是有限的。

If your app is not running in the foreground, the iBeacon monitoring API can make it launch into the background for about 5 seconds. During this time you can call a web service. But background support for bluetooth connections is limited in iOS.

如果蓝牙连接设备之间直接,你要弄清楚哪些装置,使中央和这使外围。这个谈判是复杂的。

If the bluetooth connection is directly between devices, you have to figure out which device to make the central and which to make the peripheral. This negotiation is complex.

如果蓝牙连接的各设备和信标之间,那么你可以不使用标准iBeacons - 你必须建立自定义的支持更多的连接的蓝牙服务

If the bluetooth connection is between each device and the beacon, then you can't use standard iBeacons -- you have to build custom ones that support additional connectable bluetooth services.

的Web服务方法的主要缺点是,当你没有网络连接将无法正常工作。你必须决定,如果你能忍受的缺点。

The main disadvantage of a web service approach is that it won't work when you don't have network connectivity. You have to decide if you can live with that disadvantage.

这篇关于使用iBeacon或类似技术传输数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆