c# - 如何使用 C# 在 Windows 上读取连接的 iOS 设备的 UDID?

标签 c# ios windows visual-studio udid

您能否建议如何在 Windows 上使用 C# 获取已连接 iOS 设备的 UDID?我试图在谷歌中搜索,但没有找到任何东西。有没有办法或解决方法?也许任何开源库或其他东西?

请提出建议。

提前致谢。

最佳答案

这就是问题所在,UDID 从 IOS 7 开始就被锁定了,你不应该在你的代码中访问这个 ID。有一些方法可以通过不可见的后台网页提取 ID,但这仅适用于您不打算在 iTunes 商店上发布您的应用程序的情况,因为您的应用程序将被拒绝。

2013 年,马特在他的博客 NSHipster ( http://nshipster.com/uuid-udid-unique-identifier/ ) 中写道:

As of May 1st, Apple began enforcing this deprecation on all new app submissions, even for apps targeting earlier versions of iOS. Any use of uniqueIdentifier is grounds for immediate rejection of new binaries.

(如果您希望更详细地解释此更改的来龙去脉,请阅读 Mattt 博客条目的其余部分)

对此您能做些什么?没有什么。但是,如果您需要某种 ID 来执行您想要执行的任何操作,那么您有两种选择:

identifierForVendor

此处:https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/#//apple_ref/occ/instp/UIDevice/identifierForVendor

The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.

Normally, the vendor is determined by data provided by the App Store. If the app was not installed from the app store (such as enterprise apps and apps still in development), then a vendor identifier is calculated based on the app’s bundle ID. The bundle ID is assumed to be in reverse-DNS format.

广告标识符

此处:https://developer.apple.com/library/ios/documentation/AdSupport/Reference/ASIdentifierManager_Ref/index.html#//apple_ref/occ/instp/ASIdentifierManager/advertisingIdentifier

Unlike the identifierForVendor property of the UIDevice, the same value is returned to all vendors. This identifier may change—for example, if the user erases the device—so you should not cache it.

If the value is nil, wait and get the value again later. This happens, for example, after the device has been restarted but before the user has unlocked the device.

关于c# - 如何使用 C# 在 Windows 上读取连接的 iOS 设备的 UDID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32071966/

相关文章:

c++ - 存储 wchar_t 并在显示时有时会更改一些字符

c# - 如何在从 Web 应用程序输入的数据库中以加密格式存储密码?

c# - Entity Framework 6 : Use EntityDataSource for Binding?

c# - 配置 autofac 容器

c# - valueType.ToString() 是否对 valueType 进行强制转换?

ios - 从 NIB 加载 View 返回零帧 View - 怎么办?

ios - 为什么信标会导致蓝牙不断切换?

windows - 批处理脚本在 for 循环后结束

ios - 从通用应用程序转换为 iPhone?

c++ - 用于获取 netstat -s 统计信息的 Windows API