AIR 3.5移动项目的设备ID [英] AIR 3.5 Mobile project device ID

查看:259
本文介绍了AIR 3.5移动项目的设备ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人知道存储在全局DB数据对移动设备(iOS和Android)?

I am wondering if someone knows the best method for storing data in a global DB against a mobile device (iOS and Android)?

我建立一个应用程序,写入/检索信息的基础上查询,但我需要知道是否有任何返回的记录是从该设备发送的。

I am building an app that writes/retrieves information based on a query however I need to know if any of the records returned were sent from that device.

基本上,想法是,如果用户提交了一些信息(被存储在DB)他们获得该应用的附加功能。当应用程序启动时,我会检查数据库,看看他们在过去提交的信息,并允许访问其他地区。

Basically the idea is that if a user submits some information (which is stored in the DB) they gain access to additional features of the app. When the app is launched, I will check the DB to see if they submitted information in the past and allow access to other areas.

我使用本地存储,因为他们提交的,而且远程存储的信息,所以,如果本地存储由于某种原因而损坏,还有的用户提交的信息的记录。

I use local storage for the information they submitted but also store remotely so if the local storage becomes corrupted for any reason there is still a record of the information the user submitted.

的ID必须是唯一的装置有可能是用户100(希望百万),所以ID必须是唯一的足够的,将与另一设备从未冲突。所有提交的信息将可用于检索所有其他用户。

The ID needs to be unique to the device as there could be 100 of users (hoping for millions) so the ID needs to be unique enough that it will never conflict with another device. Any information submitted will be available for retrieval by all other users.

感谢:)

推荐答案

有三个选项,因为我看到它:

There are three options as I see it:

1。用户

您可以创建一个典型的用户名+密码的用户方案,并以此来验证用户。这种方法的一个可能的好处是,用户可以在任何他们的设备(使用他们的iPhone和iPad应用程序将有两种不同的意见,用户例如,你的方法下 - 你可能不希望)日志。当然,这意味着迫使应用程序的每个用户到你的系统,这是不理想的范围内注册。

You can create a typical username + password user scheme and use this to verify the user. A possible advantage of this method would be that the user can log in from any of their devices (for instance, under your method a user using the app from their iPhone and iPad would have two different views - which you may not want). Of course, this means forcing every user of the app to register within your system, which is not ideal.

2。应用程序安装

您可以唯一地标识一个应用程序安装通过让你的应用程序生成一个 UUID 第一次应用程序被运行(您可以使用 AS3助手库生成UUID)。您可以在本地存储此UUID,并随着每次请求的应用程序,使得发送。这样做的缺点的方法是,它不唯一地识别设备 - 仅一个特定的应用程序安装。例如,如果用户删除该应用,然后重新安装它在后一点上,它现在将计数作为一个新的唯一的设备,即使该用户是在同一设备上。

You can uniquely identify an app install by having your app generate a UUID the first time that the app is run (you can use an AS3 helper library to generate the UUID). You can store this UUID locally and send it along with every request the app makes. The downside to this approach is that it doesn't uniquely identify the device - only a specific app install. For instance, if the user deletes the app and then reinstalls it at a later point, it will now count as a new unique device, even though the user is on the same device.

3。设备

AIR不具备的读取装置识别信息一内置方式。但是,您可以检索通过AIR本机扩展设备信息,例如这个可以得到的MAC地址和其他一些东西。有隐私的关注和参与阅读的其他问题和存储设备信息,如这些,所以你可能是最好的服务努力实现的 OpenUDID 项目作为AIR​​本机扩展,因为他们已经处理了所有这些问题。不幸的是,我从来不太远开发ANE的,所以我不知道如何复杂或可行的将是把OpenUDID到一个ANE。

AIR does not have a built-in way of reading device identifying info. However, you can retrieve device info through AIR Native Extensions, for example this one can get the MAC address and some other things. There are privacy concerns and other issues involved in reading and storing device info such as these, so you are probably best served trying to implement the OpenUDID project as an AIR Native Extension, since they have already dealt with all such issues. Unfortunately, I have never looked too far into developing ANE's so I am not sure how complicated or feasible it will be to turn OpenUDID into an ANE.

摘要:我建议应用程序安装方法因易于实施。如果你真的需要独特的设备和所担心的多个应用程序安装的情况下,你将不得不制定出如何使用本机扩展来获得您所需要的信息。如果你决定,你宁愿被用户识别,而不是设备,使用用户的方法。

Summary: I would recommend the app install method due to the ease of implementation. If you really need the unique device and are worried about the multiple app installs case, you will have to work out how to use native extensions to get the info you need. If you decide that you would rather identify by user rather than device, use the user method.

这篇关于AIR 3.5移动项目的设备ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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