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

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

问题描述

我想知道是否有人知道针对移动设备(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.

基本上,这个想法是,如果用户提交一些信息(存储在数据库中),他们就可以访问应用程序的其他功能.当应用启动时,我会检查数据库,看看他们过去是否提交过信息并允许访问其他区域.

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 Native Extensions 检索设备信息,例如 this one可以获得MAC地址和其他一些东西.读取和存储这些设备信息涉及隐私问题和其他问题,因此您最好尝试实施 OpenUDID 项目作为 AIR Native 扩展,因为他们已经处理了所有这些问题.不幸的是,我从来没有对 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天全站免登陆