简体   繁体   English

从应用商店安装应用程序时如何获取设备的Iphone UDID?

[英]how to get Iphone UDID of device while installing the application from app store?

In my Iphone application , i am able to get the UDID of the device and have display it on alertview. 在我的Iphone应用程序中,我能够获取设备的UDID并将其显示在alertview上。

my query is that while any user go to the apple appstore and try to istall the application, at that same time how to get the UDID of the device and store it to the Database and also want the UDID of application at the time of uninstallation. 我的查询是,当任何用户去苹果应用商店并尝试安装应用程序时,同时如何获取设备的UDID并将其存储到数据库中,以及如何在卸载时希望应用程序的UDID。

Whether is it possible or not? 有没有可能? If possible please provide any code or any useful link or any other info,which would be appreciated. 如果可能,请提供任何代码或任何有用的链接或任何其他信息,我们将不胜感激。

Thanks, 谢谢,

Mishal Shah 米沙尔·沙(Mishal Shah)

You can't run any process when your application is not actually running - this includes at download time and at uninstallation. 当您的应用程序未真正运行时,您将无法运行任何进程-这包括下载时和卸载时。

Instead, you should try to find other ways to measure what you want. 相反,您应该尝试找到其他方法来衡量所需的内容。 You can, for example, have your application keep track (in NSUserDefaults or similar) of whether or not this is the first time the user has launched your app, and if it is submit the UDID to your server. 例如,您可以让您的应用程序(以NSUserDefaults或类似方式)跟踪这是否是用户首次启动您的应用程序,以及是否将UDID提交给您的服务器。

Tracking uninstallation is a lot harder - the best you may be able to do is to keep track of how long it's been since the user last launched your app (if you have the app submit a launch time every time the user opens it). 跟踪卸载要困难得多-最好的办法是跟踪用户上次启动应用程序以来的时间(如果您有应用程序每次用户打开时都提交启动时间)。

Keep in mind that a lot of tech-savvy users will object to your gathering the UDID or usage patterns within your app without their express permission (or at all). 请记住,许多精通技术的用户会反对您未经其(或完全没有)明确许可而在您的应用程序内收集UDID或使用模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM