iBeacon:定义UUID [英] iBeacon: defining UUID

查看:424
本文介绍了iBeacon:定义UUID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在针对开发人员的官方 iBeacon指南中苹果指出

In the official iBeacon guide for developer Apple states that

应用程序开发人员应定义特定于其应用程序的UUID, 部署用例.

Application developers should define a UUID specific to their app and deployment use case.

问题:

  • A部分:如何确定UUID以确保不会与其他UUID冲突?有官方的方法可以得到一个吗?
  • B部分:假设可以使用A,那么如何确保UUID在iOS和Android设备上是唯一的?
  • Part A: How can I define a UUID in the way that I am sure it won't conflict with any others? Is there an official way to get one?
  • Part B: Assuming A is possible, how can I ensure that the UUID is unique across iOS and Android devices?

看看上面的报价,这取决于开发人员.但是,这似乎是一种非可靠的解决方案.

Looking at the quote above it seems up to the developer. However it feels like a non robust solutions.

如果问题1的B部分无法实现,那么我担心会出现以下用例:

两家公司已经为两个不同的应用定义了相同的UUID, 用户将它们都安装了.用户进入以下位置之一 其中一家公司的iBeacons(这两个iBeacons都没有 定义了次要和主要值,或者两者具有相同的次要和次要值 值).

Two companies have defined the same UUID for two different apps and a user has them both installed. The user enters in proximity with one of the iBeacons of one of the companies (both iBeacons do not have a minor and major value defined or both have the same minor and minor value).

问题2:

  • iOS和Android如何应对?这有可能吗?

推荐答案

这是一个128位的UUID.编写一个五行的MacOS X程序,该程序创建并打印一个UUID并使用它.

It's a 128 bit UUID. Write a five line MacOS X program that creates and prints a UUID and use it.

客户向您抱怨与另一台设备拥有相同的UUID的可能性不为零.但是,在他或她设法抱怨之前五秒钟,一颗流星撞击他,另一颗撞击你,而你们俩都死了的可能性更大.

There is a non-zero chance that a customer will complain to you about having the same UUID as another device. It is however more likely that one meteor strikes him, and another strikes you, and you both die, five seconds before he or she manages to complain.

这就是UUID的工作方式.

That's how UUIDs work.

这篇关于iBeacon:定义UUID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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