{"id":62233,"date":"2023-11-28T19:01:11","date_gmt":"2023-11-28T17:01:11","guid":{"rendered":"https:\/\/koninis.me\/?p=62233"},"modified":"2023-11-29T12:39:28","modified_gmt":"2023-11-29T10:39:28","slug":"the-case-of-apples-changing-identifierforvendor","status":"publish","type":"post","link":"https:\/\/koninis.me\/index.php\/2023\/11\/28\/the-case-of-apples-changing-identifierforvendor\/","title":{"rendered":"The case of Apple&#8217;s changing identifierForVendor"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">We had a case where a client reported a bug in our iOS application, <strong>affecting all its users<\/strong>, after publishing an update that had unrelated code changes. We traced the problem on the fact that the identifierForVendor value suddently started to returned different value, due to a change unrelated with our release that was undocumented.<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<!--more-->\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">According to Apple&#8217;s documentation for the identifierForVendor <\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">The value of this property is the same for apps that come from the same vendor running on the same device.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor\u2019s apps from the device and subsequently reinstalls one or more of them.<\/p>\n<cite><a href=\"https:\/\/developer.apple.com\/documentation\/uikit\/uidevice\/1620059-identifierforvendor\">Apple&#8217;s documentation<\/a><\/cite><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">However this is not the full story. <em>There are other cases where it changes and it is not obvious<\/em> but provide some insight to the inner workings of the algorithm that produces the identifierForVendor. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It turns out that the client that faced the problem had changed its legal name and then had requested Apple to change the name used in its developer account. And this caused the identifierForVendor suddenly to return an other value after an new release was published signed with the new Distribution Certificate(referencing the new account name). <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We contacted Apple support for this and their response is that this behaviour is not documented but it is <strong>resonable<\/strong> of a developer to assume it. Specifically Apple&#8217;s support response was<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Although&nbsp;the&nbsp;IdentifierForVendor&nbsp;documentation&nbsp;only&nbsp;states&nbsp;that&nbsp;the&nbsp;identifierForVendor&nbsp;value&nbsp;is&nbsp;&#8220;determined&nbsp;by&nbsp;data&nbsp;provided&nbsp;by&nbsp;the&nbsp;App&nbsp;Store&#8221;,&nbsp;it&#8217;s&nbsp;<strong>reasonable&nbsp;to&nbsp;assume<\/strong>&nbsp;that&nbsp;the&nbsp;data&nbsp;provided&nbsp;by&nbsp;the&nbsp;App&nbsp;Store&nbsp;includes&nbsp;the&nbsp;vendor&nbsp;name,&nbsp;and&nbsp;that&nbsp;a&nbsp;change&nbsp;to&nbsp;the&nbsp;vendor&#8217;s&nbsp;name&nbsp;will&nbsp;result&nbsp;in&nbsp;a&nbsp;different&nbsp;identifierForVendor&nbsp;value&nbsp;when&nbsp;the&nbsp;app&nbsp;is&nbsp;updated.&nbsp;&nbsp;As&nbsp;the&nbsp;documentation&nbsp;states,&nbsp;removal&nbsp;of&nbsp;all&nbsp;of&nbsp;the&nbsp;apps&nbsp;from&nbsp;a&nbsp;single&nbsp;vendor&nbsp;and&nbsp;subsequently&nbsp;reinstalling&nbsp;one&nbsp;or&nbsp;more&nbsp;apps&nbsp;from&nbsp;that&nbsp;vendor&nbsp;will&nbsp;also&nbsp;result&nbsp;in&nbsp;a&nbsp;new&nbsp;identifierForVendor&nbsp;value:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/developer.apple.com\/documentation\/uikit\/uidevice\/1620059-identifierforvendor\/\">https:\/\/developer.apple.com\/documentation\/uikit\/uidevice\/1620059-identifierforvendor\/<\/a><\/p>\n<\/blockquote>\n<cite>Email correspondance with Apple support<\/cite><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\"><br>It is obvious from the Apple&#8217;s support answer that the documentation does not mention clearly when the identifieForVendor changes, so we are only left with making reasonable assumptions. To avoid making\u00a0<strong>assumptions<\/strong>\u00a0(reasonable or not) we should have a proper documentation. I should note that as the documentation states we should handle changes in the identifieForVendor gracefully. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Perhaps someone should <strong>fork Apple&#8217;s documentation<\/strong> and accept PRs to improve it with rich examples and missing undocumented behaviour.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We had a case where a client reported a bug in our iOS application, affecting all its users, after publishing an update that had unrelated code changes. We traced the problem on the fact that the identifierForVendor value suddently started to returned different value, due to a change unrelated with our release that was undocumented.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"everybody","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[45,1],"tags":[48,46,47],"class_list":["post-62233","post","type-post","status-publish","format-standard","hentry","category-apple","category-uncategorized","tag-api","tag-apple","tag-documentation"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/koninis.me\/index.php\/wp-json\/wp\/v2\/posts\/62233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/koninis.me\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/koninis.me\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/koninis.me\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/koninis.me\/index.php\/wp-json\/wp\/v2\/comments?post=62233"}],"version-history":[{"count":12,"href":"https:\/\/koninis.me\/index.php\/wp-json\/wp\/v2\/posts\/62233\/revisions"}],"predecessor-version":[{"id":186565,"href":"https:\/\/koninis.me\/index.php\/wp-json\/wp\/v2\/posts\/62233\/revisions\/186565"}],"wp:attachment":[{"href":"https:\/\/koninis.me\/index.php\/wp-json\/wp\/v2\/media?parent=62233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/koninis.me\/index.php\/wp-json\/wp\/v2\/categories?post=62233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/koninis.me\/index.php\/wp-json\/wp\/v2\/tags?post=62233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}