2014年9月9日 星期二

UUID

目前iOS只提供二種UUID給developer分辨,

idfa

  • 全名:advertisingIdentifier
  •   #import <AdSupport/AdSupport.h>
    
      NSString *adId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
  • 可以被使用者在settings中關掉

idfv

  • 全名:identifierForVendor
  NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

  • 不可以被關掉,但他是綁定你Bundle ID的前面二個單字 com.harvey,所以如果使用者的手機中所有你的Bundle ID的App都被刪掉,那他再次安裝這支App時,idfv就會換掉。
可以利用KeyChain保存UUID來當作UDID來使用
http://www.cnblogs.com/smileEvday/p/UDID.html

另外還可以用Notification token ID,它在你重灌App後仍能保持一致,但如果系統重新更新就被換掉。

沒有留言:

張貼留言