获取唯一标识符(MAC地址,UDID,等...),在Adobe AIR为iOS [英] Get unique identifier (MAC address, UDID, etc...) in Adobe AIR for iOS

查看:1125
本文介绍了获取唯一标识符(MAC地址,UDID,等...),在Adobe AIR为iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得的MAC地址为用户的设备的Adobe AIR应用程序的Andr​​oid和iOS(iPad 2的)的网络适配器。

I'm trying to get the MAC address for the network adapter of the user's device in an Adobe AIR Application for Android and iOS (iPad 2).

在Android的它工作正常,但在iOS的事实并非如此。这是code我使用:

In Android it works correctly, but in iOS it doesn't. This is the code I'm using:

var vNetworkInterfaces:Vector.<NetworkInterface> = NetworkInfo.networkInfo.findInterfaces();

for each (var networkInterface:NetworkInterface in vNetworkInterfaces) {
    trace(networkInterface.hardwareAddress);
}

这工作在Android的,但在iOS中我得到这个试图运行findInterfaces()时:

This works in Android, but in iOS I get this when trying to run findInterfaces():

错误#1009:无法访问空对象引用的属性或方法

Error #1009: Cannot access a property or method of a null object reference.

如此看来networkInfo.findInterfaces()未在iOS中实现的。我试图得到的值:

So it seems networkInfo.findInterfaces() is not implemented in iOS. I tried getting the value of:

NetworkInfo.isSupported

NetworkInfo.isSupported

和的值是Android的事实,但假的在iPad 2这样看来的NetworkInfo不支持iOS的

And the value of that is true in Android but false in the iPad 2. So it seems NetworkInfo is not supported in iOS

有没有在iOS的任何其他方式获得该设备的唯一识别码? (它并不必须是MAC,我只是想唯一识别用户的设备)

Is there any other way in iOS to get a unique identifier for the device? (it doesn't have to be the MAC; I just want to uniquely identify the user's device)

推荐答案

其实,有一种方法可以让MAC联系地址在iOS太):的获取的NetworkInfo来自Android和iOS

Actually there is a way to get the MAC Adress on iOS too ;) : Getting NetworkInfo from both Android and iOS.

这篇关于获取唯一标识符(MAC地址,UDID,等...),在Adobe AIR为iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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