Get the iOS device unique identity

Source: Internet
Author: User
Tags base64
<span id="Label3"></p><p><p>Get the iOS device unique identity</p></p><style>Body {font-family:helvetica, arial, sans-serif; font-size:14px; line-height:1.6; padding-top:10px; padding-bottom:10 px background-color:white; Padding:30px}body>*:first-child {margin-top:0!important}body>*:last-child {margin-bottom:0!important}a {color: #4183C4}a.absent {color: #cc0000}a.anchor {display:block; padding-left:30px; margin-left: -30px; cursor:pointer; PO sition:absolute; top:0; left:0; Bottom:0}h1,h2,h3,h4,h5,h6 {margin:20px 0 10px; padding:0; font-weight:bold; cursor:text; position:relative}h1:ho Ver a.anchor,h2:hover a.anchor,h3:hover a.anchor,h4:hover a.anchor,h5:hover a.anchor,h6:hover a.anchor {background: URL ("data:image/png;base64,ivborw0kggoaaaansuheugaaabaaaaaqcayaaaaf8/ 9haaaagxrfwhrtb2z0d2fyzqbbzg9izsbjbwfnzvjlywr5ccllpaaaa09pvfh0we1momnvbs5hzg9izs54bxaaaaaaadw/ ehbhy2tldcbizwdpbj0i77u/iibpzd0ivzvnme1wq2voauh6cmvtek5uy3pryzlkij8+ Idx4onhtcg1ldgegeg1sbnm6ed0iywrvymu6bnm6bwv0ys8iihg6eg1wdgs9ikfkb2jlifhnucbdb3jliduumy1jmdexidy2lje0Nty2mswgmjaxmi8wmi8wni0xndo1njoynyagicagicagij4gphjkzjpsreygeg1sbnm6cmrmpsjodhrwoi8vd3d3lnczlm9yzy8xotk5lzaylziylxjkzi1ze W50yxgtbnmjij4gphjkzjpezxnjcmlwdglvbibyzgy6ywjvdxq9iiigeg1sbnm6eg1wpsjodhrwoi8vbnmuywrvymuuy29tl3hhcc8xljaviib4bwxuczp4bx Bntt0iahr0cdovl25zlmfkb2jllmnvbs94yxavms4wl21tlyigeg1sbnm6c3rszwy9imh0dha6ly9ucy5hzg9izs5jb20vegfwlzeumc9zvhlwzs9szxnvdxj jzvjlzimiihhtcdpdcmvhdg9yvg9vbd0iqwrvymugughvdg9zag9wientniaomtmumcaymdeymdmwns5tljqxnsaymdeylzazlza1ojixojawojawksagke1h Y2ludg9zackiihhtce1nokluc3rhbmnlsuq9inhtcc5pawq6oum2njldqji4odbgmtffmtg1odleodnerdjbrjuwqtqiihhtce1nokrvy3vtzw50suq9inhtc C5kawq6oum2njldqjm4odbgmtffmtg1odleodnerdjbrjuwqtqipia8eg1wtu06rgvyaxzlzezyb20gc3rszwy6aw5zdgfuy2vjrd0ieg1wlmlpzdo5qzy2ou Ncmdg4meyxmuuxodu4ouq4m0remkfgntbbncigc3rszwy6zg9jdw1lbnrjrd0ieg1wlmrpzdo5qzy2ouncmtg4meyxmuuxodu4ouq4m0remkfgntbbncivpia 8l3jkzjpezxnjcmlwdglvbj4gpc9yzgy6ukrgpia8l3g6eg1wbwv0yt4gpd94cgfja2v0igvuzd0icii/psqhxeaaaabfsurbvhjayvz// Z8djycrugmyqabambqiaveqkbqwxi6shqwhiwg70ttbxgaiwwjctggougjif1j8wmraiua34b4q76hubelafjysa0cumiearp8wgikgma54bgqimacamkxji0hkjqaaaabjru5erkjggg== ") No-repeat 10px center; TEXT-DECORATION:NONE}H1 tt,h1 Code {font-size:inherit}h2 TT,H2 code {font-size:inherit}h3 TT,H3 code {font-size: Inherit}h4 TT,H4 Code {font-size:inherit}h5 TT,H5 code {font-size:inherit}h6 tt,h6 code {FONT-SIZE:INHERIT}H1 { font-size:28px; COLOR:BLACK}H2 {font-size:24px; border-bottom:1px solid #cccccc; color:black}h3 {font-size:18px}h4 {font-size: 16px}h5 {font-size:14px}h6 {color: #777777; font-size:14px}p,blockquote,ul,ol,dl,li,table,pre {margin:15px 0}hr {background:transparent URL ("data:image/png;base64, Ivborw0kggoaaaansuheugaaaayaaaaecayaaactbe5daaaagxrfwhrtb2z0d2fyzqbbzg9izsbjbwfnzvjlywr5ccllpaaaayjpvfh0we1momnvbs5hzg9iz s54bxaaaaaaadw/ehbhy2tldcbizwdpbj0i77u/iibpzd0ivzvnme1wq2voauh6cmvtek5uy3pryzlkij8+ idx4onhtcg1ldgegeg1sbnm6ed0iywrvymu6bnm6bwv0ys8iihg6eg1wdgs9ikfkb2jlifhnucbdb3jliduumc1jmdywidyxljezndc3nywgmjaxmc8wMi8xmi0xnzozmjowmcagicagicagij4gphjkzjpsreygeg1sbnm6cmrmpsjodhrwoi8vd3d3lnczlm9yzy8xotk5lzaylziylxjkzi1zew50yxgtbnmjij4gp Hjkzjpezxnjcmlwdglvbibyzgy6ywjvdxq9iiigeg1sbnm6eg1wpsjodhrwoi8vbnmuywrvymuuy29tl3hhcc8xljaviib4bwxuczp4bxbntt0iahr0cdovl2 5zlmfkb2jllmnvbs94yxavms4wl21tlyigeg1sbnm6c3rszwy9imh0dha6ly9ucy5hzg9izs5jb20vegfwlzeumc9zvhlwzs9szxnvdxjjzvjlzimiihhtcdp Dcmvhdg9yvg9vbd0iqwrvymugughvdg9zag9wientnsbnywnpbnrvc2giihhtce1nokluc3rhbmnlsuq9inhtcc5pawq6oendrjnbn0e2ntzbmtffmei3qjrb Odm4nzjdmjlgndgiihhtce1nokrvy3vtzw50suq9inhtcc5kawq6oendrjnbn0i2ntzbmtffmei3qjrbodm4nzjdmjlgndgipia8eg1wtu06rgvyaxzlzezyb 20gc3rszwy6aw5zdgfuy2vjrd0ieg1wlmlpzdo4q0ngm0e3ody1nkexmuuwqjdcnee4mzg3mkmyouy0ocigc3rszwy6zg9jdw1lbnrjrd0ieg1wlmrpzdo4q0 Ngm0e3oty1nkexmuuwqjdcnee4mzg3mkmyouy0ocivpia8l3jkzjpezxnjcmlwdglvbj4gpc9yzgy6ukrgpia8l3g6eg1wbwv0yt4gpd94cgfja2v0igvuzd0 ICII/PQQEZSUAAAAFSURBVHJAYMRABCYWBIM2QSA4Y4HNEKYDQXAEAAIMAHNGAZHKPOLYAAAAAELFTKSUQMCC ") repeat-x 0 0; border:0 none; Color: #cccccc; height:4px; PaddinG:0}body>h2:first-child {margin-top:0; padding-top:0}body>h1:first-child {margin-top:0; Padding-top:0}body>h1:fi RST-CHILD+H2 {margin-top:0; padding-top:0}body>h3:first-child,body>h4:first-child,body>h5:first-child,body>h6: First-child {margin-top:0; padding-top:0}a:first-child h1,a:first-child h2,a:first-child h3,a:first-child h4,a: First-child h5,a:first-child h6 {margin-top:0; padding-top:0}h1 p,h2 p,h3 p,h4 p,h5 p,h6 p {margin-top:0}li p.first {display:inline-block}li {margin:0}ul,ol {padding-left:30px}ul:first-child,ol:first-child {MARGIN-TOP:0}DL {PADDING:0}DL DT {font-size:14px; font-weight:bold; font-style:italic; padding:0; margin:15px 0 5px}dl dt:first- Child {padding:0}dl dt>:first-child {margin-top:0}dl dt>:last-child {margin-bottom:0}dl dd {margin:0 0 15px; PA dding:0 15px}dl dd>:first-child {margin-top:0}dl dd>:last-child {margin-bottom:0}blockquote {border-left:4px Sol ID #dddddd; padding:0 15px; Color: #777777}blockquote>:first-child {margin-top:0}blockquote>:last-child {margin-bottom:0}table {padding:0; Border-colla pse:collapse}table TR {border-top:1px solid #cccccc; background-color:white; margin:0; padding:0}table Tr:nth-chil D (2n) {background-color: #f8f8f8}table tr th {font-weight:bold; border:1px solid #cccccc; margin:0; padding:6px 13p x}table TR TD {border:1px Solid #cccccc; margin:0; padding:6px 13px}table tr th:first-child,table TR Td:first-chil D {margin-top:0}table TR th:last-child,table tr td:last-child {margin-bottom:0}img {max-width:100%}span.frame { display:block; Overflow:hidden}span.frame>span {border:1px solid #dddddd; display:block; float:left; overflow:hidden; margin:13px 0 0; padding:7px; Width:auto}span.frame span img {display:block; float:left}span.frame span span {clear:both; color: #333333; DISPLA y:block; padding:5px 0 0}span.align-center {display:block; overflow:hidden; clear:both}span.align-cenTer>span {display:block; overflow:hidden; margin:13px auto 0; text-align:center}span.align-center span img {margin: 0 auto; Text-align:center}span.align-right {display:block; overflow:hidden; Clear:both}span.align-right>span {display:blo ck overflow:hidden; MARGIN:13PX 0 0; Text-align:right}span.align-right span img {margin:0; text-align:right}span.float-left {display:block; margin-righ t:13px; overflow:hidden; Float:left}span.float-left span {margin:13px 0 0}span.float-right {display:block; margin-left:13px; Overflow:hidd En Float:right}span.float-right>span {display:block; overflow:hidden; margin:13px Auto 0; text-align:right}code,tt { margin:0 2px; padding:0 5px; white-space:nowrap; BORDER:1PX Solid #eaeaea; Background-color: #f8f8f8}pre Code {margin:0; padding:0; white-space:pre; border:none; background:transparent}.hig Hlight Pre {background-color: #f8f8f8; border:1px solid #cccccc; font-size:13px; line-height:19px; OVERFLow:auto; padding:6px 10px}pre {background-color: #f8f8f8; border:1px solid #cccccc; font-size:13px; line-height:19px; Overflo w:auto; PADDING:6PX 10px}pre code,pre tt {background-color:transparent; border:none}sup {font-size:0.83em; vertical-align: Super LINE-HEIGHT:0}KBD {display:inline-block; padding:3px 5px; font-size:11px; line-height:10px; color: #555; vertical-a lign:middle; Background-color: #fcfcfc; Border:solid 1px #ccc; Border-bottom-color: #bbb}* {}</style><style>code[class*= "language-"],pre[class*= "language-"] {color:black; background:none; font-family:consolas, Monaco, " Andale Mono "," Ubuntu Mono ", monospace; text-align:left; white-space:pre; word-spacing:normal; line-height:1.5}pre[class*= "language-"] {position:relative; margin:. 5em 0; border-left:10px solid #358ccb; Backgroun D-color: #fdfdfd; Background-image:linear-gradient (transparent 50%, rgba (142, 209, 0.04) 50%); overflow:visible padding:0 s*= "language"] {max-height:inherit; height:100%; padding:0 1em; display:block; overflow:auto}:not (pre) >code[class*= "language-"],pre[class*= "language-" {background-color: #fdfdfd; margin-bottom:1em}:not (pre) >code[class*= " language-"] {position:relative; padding:. 2em; color: #c92c2c; border:1px solid rgba (0, 0, 0, 0.1); display:inline; WH ite-space:normal}pre[class*= "language-"]::before,pre[class*= "language-"]::after {content: ""; z-index:-2; display:block; position:absolute; bottom:0.75em; left:0.18Em width:40%; height:20%; Max-height:13em}:not (pre) >code[class*= "language-"]::after,pre[class*= "language-"]::after {right:0.75em; left: Auto}.token.comment,.token.block-comment,.token.prolog,.token.doctype,.token.cdata {color: #7D8B99}. Token.punctuation {color: #5F6364}.token.property,.token.tag,.token.boolean,.token.number,.token.function-name,. token.constant,.token.symbol,.token.deleted {color: #c92c2c}.token.selector,.token.attr-name,.token.string,. token.char,.token.function,.token.builtin,.token.inserted {color: #2f9c0a}.token.operator,.token.entity,. Token.url,.token.variable {color: #a67f59; Background:rgba (255, 255, 255, 0.5)}.token.atrule,.token.attr-value,. Token.keyword,.token.class-name {color: #1990b8}.token.regex,.token.important {color: #e90}.language-css. Token.string,.style. token.string {color: #a67f59; background:rgba (255, 255, 255, 0.5)}.token.important {font-weight: Normal}.token.bold {font-weight:bold}.token.italic {font-style:italic}.token.entity {cursor:help}.namespace {opacity:. 7}.token.tab:not (: empty):: before,.token.cr::before,.token.lf:: Before {color: #e0d7d1}pre[class*= "language-"].line-numbers {padding-left:0}pre[class*= "language-"].line-numbers Code {padding-left:3.8em}pre[class*= "language-"].line-numbers. line-numbers-rows {left:0}pre[class*= "language-"] [ data-line] {padding-top:0; padding-bottom:0; padding-left:0}pre[data-line] code {position:relative; padding-left:4 Em}pre. Line-highlight {margin-top:0}</style><style><style>pre.line-numbers { position: relative; padding-left: 3.8em; counter-reset: linenumber }pre.line-numbers>code { position: relative }.line-numbers .line-numbers-rows { position: absolute; top: 0; font-size: 100%; left: -3.8em; width: 3em; letter-spacing: -1px; border-right: 1px solid #999 }.line-numbers-rows>span { display: block; counter-increment: linenumber }.line-numbers-rows>span::before { content: counter(linenumber); color: #999; display: block; padding-right: 0.8em; text-align: right }</style></style><style><style>div.prism-show-language { position: relative }div.prism-show-language>div.prism-show-language-label { color: black; background-color: #CFCFCF; display: inline-block; position: absolute; bottom: auto; left: auto; top: 0; right: 0; width: auto; height: auto; font-size: 0.9em; padding: 0 0.5em; z-index: 1 }</style></style> <center> <center> Get the iOS device unique identity </center> </center> <center> <center> Outline </center> </center> <ul> <ul> <li>Mind Mapping</li> <li>Details</li> </ul> </ul> <center> <center> Mind Mapping </center> </center> <center> <center> Details </center> </center>UDID<p style="text-indent: 2em"><p style="text-indent: 2em">In the previous version is can be used, iOS5 and later, was banned by Apple (deprecated). Although this udid is used extensively, it has to be said that it is slowly moving away from the developer and cannot consider using UDID. It remains to be seen whether the identifier is to be private or to be removed entirely from a later version of Ios. however, This udid is very handy when deploying an Enterprise-class signature Program.</p></p><p><p>Here's how to get udid: <span style="color: green">nsstring *udid = [[uidevice currentdevice] uniqueidentifier];</span></p></p><p><p>Example:<span style="color: red">bb4d786633053a0b9c0da20d54ea7e38e8776da4</span></p></p>Openudid (an Open Source project on Github)<p style="text-indent: 2em"><p style="text-indent: 2em">When iOS 5 was released, Udid was deprecated, causing the vast majority of developers to look for a solution that would replace Udid and not be controlled by apple. This openudid became the most widely used open source Udid Alternative. Openudid is easy to implement in engineering and supports a range of advertising Providers.</p></p><p><p>Here's how to get udid: <span style="color: green">nsstring *openudid = [openudid value];</span></p></p><p style="text-indent: 2em"><p style="text-indent: 2em">The Openudid principle is to use the Uipasteboard Clipboard class in the iOS system, which uses app-special pastboards to store 1160-bit random strings that are accessed in a way similar to the key-value of a dictionary. App-special Pastboards can persist strings, even when switching, uninstalling, and sharing between apps. Openudid first visit with key to check if there is a corresponding value (random number) in the clipboard, if it does not exist to generate one and stored in the pasteboard, the second access can be directly taken without generating a new random number. But after iOS7, Apple blocked the vulnerability of the Clipboard communication, before iOS is all apps can share the same clipboard storage content, now only under the same cfbundleidentifier identity of the app to share content, such as COM.KOUDAI.A and com.koudai.b, their com.mycompany part is the same, can be shared (please use the real machine test, the simulator will be biased).</p></p>Uuid<p style="text-indent: 2em"><p style="text-indent: 2em">Most of the current applications are uuid, which is a way to get large random numbers after Apple re-iOS6. uuid, the global Independent logo (globally Unique Identifier), According to the wiki, the UUID random number algorithm obtained a number of repetition probability of 17 billion, one of 17 billion points what concept? Can tell you to buy a note color Ball's winning probability is one of 17 million points.</p></p>Here are a few ways to get to the uuid, each of which is different: Cfuuid<p style="text-indent: 2em"><p style="text-indent: 2em">From the beginning of the iOS2.0, Cfuuid had already appeared. It is part of the Corefoundatio package, so the API belongs to the C language Style. The Cfuuidcreate method is used to create the cfuuidref, and a corresponding nsstring can be obtained. The system is not stored for this cfuuid Value. Each time you call cfuuidcreate, the system returns a new unique Identifier. If you want to store this identifier, you need to store it yourself in nsuserdefaults, Keychain, pasteboard, or somewhere else.</p></p><p><p>Get the Cfuuid method as Follows: <span style="color: green">cfuuidref cfuuid = cfuuidcreate (kcfallocatordefault); NSString *cfuuidstring = (nsstring*) cfbridgingrelease (cfuuidcreatestring (kcfallocatordefault, cfuuid));</span></p></p><p><p>Example:<span style="color: red">68753a44-4d6f-1226-9c60-0050e4c00067</span></p></p>Nsuuid<p style="text-indent: 2em"><p style="text-indent: 2em">Nsuuid only appears in iOS 6, which is almost exactly the same as cfuuid, except that it is a objective-c interface. Like cfuuid, This value system is not stored and a new unique identifier is obtained each time it is Called. If you want to store it, you need to store it yourself.</p></p><p><p>Get the Nsuuid method as Follows:<span style="color: green">nsstring *uuid = [[nsuuid uuid] uuidstring];</span></p></p><p><p>Example:<span style="color: red">68753a44-4d6f-1226-9c60-0050e4c00067</span></p></p>Idfa-identifierforidentifier<p style="text-indent: 2em"><p style="text-indent: 2em">This is another new approach in iOS 6, and Advertisingidentifier is part of the new framework Adsupport.framework. The Asidentifiermanager Singleton provides a method for advertisingidentifier, which returns a Nsuuid instance mentioned above by calling the Method.</p></p><p style="text-indent: 2em"><p style="text-indent: 2em">Unlike Cfuuid and nsuuid, ad identifiers are stored by the System. however, even though this is stored by the system, there are several cases where the ad identifier is Regenerated. This ad identifier is regenerated if the user completely resets the system (restore location and privacy, general-purpose, setup, and so on). In addition, if the user explicitly restores the ads (set-up, general-purpose, and so on, to the ads, and restore the ad identifiers), then the ad identifiers will be Regenerated. With respect to the restoration of the ad identifier, it is important to note that if the program is running in the background, the user "restores the ad identifier" and then goes back to the program, and then gets the ad identifier and does not immediately get the restored Identifier. You must terminate the program before restarting the program to obtain the restored AD Identifier. I guess this is because Asidentifiermanager is a single case.</p></p><p style="text-indent: 2em"><p style="text-indent: 2em">The user has a controllable switch to "limit ad tracking" for the ad identifier. Nick Arnott's article has been pointed Out. Turn this switch on and actually do nothing, but that's what you want to limit your access to the ad identifier. This switch is a simple Boolean flag, and when you send the ad identifier to any server side, You'd better judge the value and then make the Decision.</p></p>Note: AppStore prohibits IDFA apps from being collected without using ADS. Please refer to<p><p>Get the Idfa method as Follows:<span style="color: green">nsstring *adid = [[[asidentifiermanager sharedmanager] advertisingidentifier] uuidstring];</span></p></p><p><p>Example:<span style="color: red">e2dfa89-496a-47fd-9941-df1fc4e6484a</span></p></p>Idfv-identifierforvendor<p style="text-indent: 2em"><p style="text-indent: 2em">This is also added to iOS 6, but the new method of getting this IDFV is added to the existing Uidevice class. As with advertisingidentifier, This method returns a Nsuuid Object.</p></p><p style="text-indent: 2em"><p style="text-indent: 2em">In Apple's official document, Identifierforvendor has the following description: the value of this property is the same for apps, come from the same vendor RU Nning on the same device. A different value is returned for apps on the same device this come from different vendors, and to apps on different Devi Ces regardless of vendor. this means that the same string is returned if the vendor is the same as the value of vendor, or a different string if the vendor is Different.</p></p><p style="text-indent: 2em"><p style="text-indent: 2em">Vendor explanation: English explanation for sellers, Hawkers. According to the Xcode documentation, it is normal to judge according to the data provided by the app Store. however, If the app is not installed through the App Store (such as an enterprise application or development debugging phase), it will be judged based on the bundle ID.</p></p><p><p>Get the Idfa method as Follows:<span style="color: green">nsstring *IDFV = [[[uidevice currentdevice] identifierforvendor] uuidstring];</span></p></p><p><p>Example:<span style="color: red">e2dfa89-496a-47fd-9941-df1fc4e6484a</span></p></p>Note: a natural person<p><p>Get the iOS device unique identity</p></p></span>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.