Alternative to iPhone device ID (UDID)

简介:

Possible Duplicate:
UIDevice uniqueIdentifier Deprecated - What To Do Now?

Even if Apple was not at Barcelone's MWC (mobile world congress), there was the certitude that getting the deviceID will be deprecated in further iOS SDK.

I do not understand why Apple want to restrict this, but that's not the topic.

I must prepare my application to an alternative because my users are identified and known for a better use of my app (don't need to log, or create an account, for example). And I'm sure I'm not alone in that case.

So anybody know an alternative from getting the deviceID ? Is there other unique identifier, like MAC address, for example ? How do you prepare your app ?

share | edit | flag
 
   
   
you want the iphone device id or sth other? – Anil Mar 9 '12 at 9:28
   
   
I want another unique identifer that deviceId, or another way to identify user. – Martin Mar 9 '12 at 9:41
add comment (requires 50 reputation)

marked as duplicate by casperOne Sep 20 '12 at 11:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3 Answers

up vote 4 down vote accepted

UPDATE

What about using CFUUID to generate a UUID. You can than store it in KEYCHAIN on the very first launch.. you can get it like this...

NSString*uuid = nil;CFUUIDRef theUUID =CFUUIDCreate(kCFAllocatorDefault);if(theUUID){
  uuid =NSMakeCollectable(CFUUIDCreateString(kCFAllocatorDefault, theUUID));[uuid autorelease];CFRelease(theUUID);}

and also by deprecating the uniqueIdentifier method, Apple is suggesting that you don't identify per device but instead per app install. may be tomorrow they might decide to reject your app for doing this .. :/ hoping this helps.

share | edit | flag
 
   
   
Thanks, but it wouldn't be the same if the user delete and install again the app (which, i admit, does not occurs often). Another thing, this UUID is generated on a machine, so may not be unique throught our user list on our server. – Martin Mar 9 '12 at 9:39
   
   
@Martin What about storing the value in keychain...? that wouldn't go away once the app is uninstalled..? and also by deprecating the uniqueIdentifier method, Apple is suggesting that you don't identify per device but instead per app install. may be tomorrow they might decide to reject your app for doing this .. :/ – Ankit Srivastava Mar 9 '12 at 9:49
   
   
@Martin please check the update. – Ankit Srivastava Mar 9 '12 at 10:04
2  
   
You could store this UUID created this way in iCloud and then pull from there if you don't have it stored on the device. That would give you a UUID unique to a certain user, which might be what you want? – mattjgalloway Mar 9 '12 at 10:26
2  
   
does not work in iOS 5 – Abhishek Bedi May 25 '12 at 12:24
show 3 more comments

try this

-(NSString*)getDeviceID
{NSString*uuid =[self gettingString:@"uniqueAppId"];if(uuid==nil ||[uuid isEqualToString:@""]){CFUUIDRef theUUID =CFUUIDCreate(kCFAllocatorDefault);if(theUUID){
            uuid =NSMakeCollectable(CFUUIDCreateString(kCFAllocatorDefault, theUUID));[self savingString:@"uniqueAppId" data:uuid];[uuid autorelease];CFRelease(theUUID);}}return uuid;// this is depreciated  //  UIDevice *device = [UIDevice currentDevice];//  return [device uniqueIdentifier];}
share | edit | flag
 
   
   
Thanks, that's the same answers as below. See my comment. – Martin Mar 9 '12 at 9:39
   
   
then you have to use mac address of the device – hchouhan02 Mar 9 '12 at 10:10
add comment (requires 50 reputation)

Please implement the new logic to get Secure UDID.it is provided by Third Party

Learn about free solution:

This really works fine and is easy to implememt without making it a fuss to replace the deprecated method.

share | edit | flag
 
   
   
Thanks for the link. There are several UID api that are growing around the web. I don't tested one of them yet. – Martin May 25 '12 at 12:19
   
   
The link is broken – André Cytryn Feb 19 at 19:55
   
   
Hi Andre I have updated the link. – Shantanu Feb 20 at 5:40
add comment (requires 50 reputation)
欢迎加群互相学习,共同进步。QQ群:iOS: 58099570 | Android: 572064792 | Nodejs:329118122 做人要厚道,转载请注明出处!


















本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/sunshine-anycall/p/3330616.html ,如需转载请自行联系原作者


相关文章
|
编解码 iOS开发
iphone 开发的基本入门知识
iphone 开发的基本入门知识
147 0
「镁客早报」iPhone或将在今年采用三摄;传Facebook致力于开发语音助力服务与亚马逊、苹果竞争
亚马逊向美国Alexa设备推免费音乐服务;视频会议软件开发商Zoom纳斯达克上市。
225 0
|
Web App开发 缓存 开发工具
|
存储 iOS开发 计算机视觉