2012-03-30 84 views
1

我想检查用户是否已经为特定页面投票,这是通过检查数据库中是否存在设备uuid来完成的,因此任何人都可以帮助我找到手机中的设备uuid并使用该设备uuid来检查在马php脚本?如何通过phonegap找到uuid的iphone?

回答

0

检查Phonegap文档。

http://docs.phonegap.com/en/1.5.0/phonegap_device_device.md.html#Device

function onDeviceReady() { 
     var element = document.getElementById('deviceProperties'); 

     element.innerHTML = 'Device Name: '  + device.name  + '<br />' + 
          'Device PhoneGap: ' + device.phonegap + '<br />' + 
          'Device Platform: ' + device.platform + '<br />' + 
          'Device UUID: '  + device.uuid  + '<br />' + 
          'Device Version: ' + device.version + '<br />'; 
    } 
+0

可以告诉我应该在哪里使用这段代码?我的意思是它在js文件或html? – user1285402 2012-03-30 08:24:40

+0

在HTML文件... – iPrabu 2012-03-30 08:26:32

+0

请注意,UDID已被弃用,苹果开始还是用它来拒绝的应用程序。 – rckoenes 2012-03-30 08:28:59

4

我会尽量避免使用UUID,苹果可能会拒绝你的申请,如果你使用它。使用替代方法来识别单个用户。

TechCrunch reports that Apple has begun rejecting iOS apps for the use of a 
unique device identifier known as the UDID. The site notes that several developers 
have reported rejections for the use of the UDID in the past week, and Apple is said 
to be ramping up the enforcement of this policy over the next few weeks. 

来源:http://forums.macrumors.com/showthread.php?t=1348294

+0

感谢您的信息 – user1285402 2012-03-30 08:33:30

+0

,所以我们不应该在有应用程序使用设备UUID?或者是有使用它的任何其他方式? – user1285402 2012-03-30 08:37:16

+0

你应该避免使用它。 – ader 2012-03-30 09:07:25

2

它必须注意一个UDID和UUID之间的区别。

UDID“唯一设备ID”是硬件特定的。它永远不会改变一个特定的设备。出于这个原因,它已成为一个隐私问题,苹果正在阻止试图使用它的应用程序。因此,Apple已经生成了一个选择退出的“设备ID”哈希,特别是对于广告使用。这个新的ID散列称为IFA,可在iOS 6.0或更高版本中使用。这是一个公平的选择,但可以随时由用户禁用。

UUID“通用唯一ID”不是硬件特定的。它是用来识别设备的散列。但不是绝对的价值。 PhoneGap根据设备属性生成一个UUID;这是您在执行device.uuid时所得到的结果。如果你删除了应用程序并重新安装,你会得到一个新的ID散列。 UUID未被Apple阻止。