{"id":36294,"date":"2022-06-22T16:43:49","date_gmt":"2022-06-22T20:43:49","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=36294"},"modified":"2023-05-29T10:16:02","modified_gmt":"2023-05-29T14:16:02","slug":"broken-renewal-of-mas-receipts","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2022\/06\/22\/broken-renewal-of-mas-receipts\/","title":{"rendered":"Broken Renewal of MAS Receipts"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/structuredpath\/AppleBugReports\/tree\/main\/FB9789052\">Lukas Kubanek<\/a> (FB9789052, <a href=\"https:\/\/twitter.com\/lukaskubanek\/status\/1539599120280813570\">tweet<\/a>):<\/p>\n<blockquote cite=\"https:\/\/github.com\/structuredpath\/AppleBugReports\/tree\/main\/FB9789052\"><p>I started integrating on-device App Store receipt validation into my Mac app, currently not utilizing StoreKit for any kind of in-app purchases. I followed the documentation and employed a check that calls <code>exit(173)<\/code> if the receipt is invalid. According to the documentation, this should trigger a renewal of the receipt. When I launch the app from Xcode&rsquo;s build folder for the first time, I get correctly presented with the App Store login window. After entering credentials of a sandbox user configured in App Store Connect, the app quits, relaunches, and then the following dialog appears:<\/p><blockquote><p>&ldquo;MyApp&rdquo; is damaged and can&rsquo;t be opened. Delete &ldquo;MyApp&rdquo; and download it again from the App Store.<\/p><\/blockquote><\/blockquote>\n<p>This has been broken since around the release of Monterey. This makes it impossible to test the Mac App Store builds of my apps before submitting them to the store. Fortunately, my receipt validation code is already written and working reliably, because I don&rsquo;t know how I could fully test it without being able to download a receipt.<\/p>\n\n<blockquote cite=\"https:\/\/github.com\/structuredpath\/AppleBugReports\/tree\/main\/FB9789052\"><p>The mentioned issue doesn&rsquo;t only occur in the sandbox but also for production apps. When removing the <tt>_MASReceipt<\/tt> folder from the production app, it&rsquo;s supposed to renew the receipt when launched. Instead, the same dialog informing about the damaged app is shown, and the app has to be re-downloaded entirely from the Mac App Store.<\/p><\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2022\/06\/21\/wwdc-lab-more-useful-than-feedback\/\">WWDC Lab More Useful Than Feedback<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2016\/04\/04\/working-around-broken-mac-app-store-test-account-switching\/\">Working Around Broken Mac App Store Test Account Switching<\/a><\/li>\n<\/ul>\n\n<p id=\"broken-renewal-of-mas-receipts-update-2022-06-27\">Update (2022-06-27): Oddly, Apple seems to have <a href=\"https:\/\/twitter.com\/mjtsai\/status\/1540047287119904770\">fixed<\/a> the longstanding problem the next day.<\/p>","protected":false},"excerpt":{"rendered":"<p>Lukas Kubanek (FB9789052, tweet): I started integrating on-device App Store receipt validation into my Mac app, currently not utilizing StoreKit for any kind of in-app purchases. I followed the documentation and employed a check that calls exit(173) if the receipt is invalid. According to the documentation, this should trigger a renewal of the receipt. When [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2022-06-22T20:43:52Z","apple_news_api_id":"9ff682e7-7e72-420e-ae5a-9776904ae7f5","apple_news_api_modified_at":"2023-05-29T14:16:05Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAABA==","apple_news_api_share_url":"https:\/\/apple.news\/An_aC535yQg6uWpd2kErn9Q","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[2392,131,1361,30,39,2077,71],"class_list":["post-36294","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-app-store-receipt-validation","tag-bug","tag-itunes-connect-sandbox-testers","tag-mac","tag-macappstore","tag-macos-12","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=36294"}],"version-history":[{"count":5,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36294\/revisions"}],"predecessor-version":[{"id":36359,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36294\/revisions\/36359"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=36294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=36294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=36294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}