{"id":3345,"date":"2020-11-09T11:41:29","date_gmt":"2020-11-09T10:41:29","guid":{"rendered":"https:\/\/blog.tomayac.com\/2020\/11\/09\/submitting-and-distributing-a-safari-app-extension\/"},"modified":"2020-11-09T11:41:29","modified_gmt":"2020-11-09T10:41:29","slug":"submitting-and-distributing-a-safari-app-extension","status":"publish","type":"post","link":"https:\/\/tomayac.com\/wordpress\/2020\/11\/09\/submitting-and-distributing-a-safari-app-extension\/","title":{"rendered":"Submitting and Distributing a Safari App Extension"},"content":{"rendered":"\n\t\t\t<p>Safari 14 has\n<a href=\"https:\/\/developer.apple.com\/documentation\/safari-release-notes\/safari-14-release-notes#New-Features:~:text=Added%20Safari%20Web%20Extensions%20support%20for%20macOS.\">added support<\/a>\nfor the\n<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Mozilla\/Add-ons\/WebExtensions\">Web Extensions<\/a>\nstandard,\nwhich I consider a clever move on Apple's side that deprecated Safari's previous\n<a href=\"https:\/\/developer.apple.com\/documentation\/safariextensions\"><code>.safariextz<\/code>-style Safari extensions<\/a>.\nWhile there is great documentation for\n<a href=\"https:\/\/developer.apple.com\/documentation\/safariservices\/safari_web_extensions\/creating_a_safari_web_extension\">creating a Safari Web Extension from scratch<\/a>\nor for\n<a href=\"https:\/\/developer.apple.com\/documentation\/safariservices\/safari_web_extensions\/converting_a_web_extension_for_safari\">converting a Web Extension for Safari<\/a>\n(and at least the outlines for\n<a href=\"https:\/\/developer.apple.com\/documentation\/safariservices\/safari_app_extensions\/converting_a_legacy_safari_extension_to_a_safari_app_extension\">converting a legacy Safari extension to a Safari app extension<\/a>),\nthe documented path currently ends at\n<a href=\"https:\/\/developer.apple.com\/documentation\/safariservices\/safari_app_extensions\/building_a_safari_app_extension#2957926\">building and running the application<\/a>.\nThis post documents the steps for submitting and distributing a Safari App Extension.<\/p>\n<p>The post assumes you already have an Xcode project either created\n<a href=\"https:\/\/developer.apple.com\/documentation\/safariservices\/safari_web_extensions\/creating_a_safari_web_extension\">manually<\/a>\nor via the\n<a href=\"https:\/\/developer.apple.com\/documentation\/safariservices\/safari_web_extensions\/converting_a_web_extension_for_safari\">converter script<\/a>\nand that you use Swift.\nHere is an\n<a href=\"https:\/\/github.com\/google\/service-worker-detector\/blob\/9a1630b002664ca128dd1b2375a4646739cb2320\/package.json#L11\">example build script<\/a>\nfor <a href=\"https:\/\/github.com\/google\/service-worker-detector\">one of my extensions<\/a> for reference.\nSome of these steps may improve or change over time for new versions of Xcode; this guide was written for Version 12.0 (12A7209).\nCaveat: this is my first time interacting with Xcode, so if any of the steps do not make sense, thanks for\n<a href=\"https:\/\/github.com\/tomayac\/blogccasion\/tree\/master\/posts\/2020\/11\/submitting-and-distributing-a-safari-app-extension.md\">correcting me<\/a>.<\/p>\n<ol>\n<li>Change the <strong>bundle identifier<\/strong> of the <strong>extension<\/strong> from <code>com.example.foo<del>-<\/del>Extension<\/code> to\n<code>com.example.foo<ins>.<\/ins>Extension<\/code> (that is, replace the '<code>-<\/code>' with a '<code>.<\/code>') and reflect the change in\n<code>ViewController.swift<\/code>. For some reason this is necessary.\n<img src=\"https:\/\/blog.tomayac.com\/images\/xcode-bundle-identifier.png\" alt=\"Xcode bundle identifier\"><\/li>\n<li>Change the <strong>App Category<\/strong>.<\/li>\n<li>Change the <strong>version number<\/strong> for app and extension.<\/li>\n<li>Update the <strong>build number<\/strong> in app and extension.<\/li>\n<li>Create a new <strong>certificate<\/strong> <a href=\"https:\/\/developer.apple.com\/account\/resources\/profiles\/add\">via your developer profile<\/a>.<\/li>\n<li>Create a new <strong>app<\/strong> via <a href=\"https:\/\/appstoreconnect.apple.com\/apps\">App Store Connect<\/a>.<\/li>\n<li>In Xcode, run <code>Product &gt; Build<\/code> and then <code>Product &gt; Archive<\/code>.<\/li>\n<li>In Xcode, open <code>Window &gt; Organizer<\/code> and then first <strong>validate<\/strong>, then <strong>distribute<\/strong> (don't change any of the settings).<\/li>\n<li>Hope for the best\u2026<\/li>\n<\/ol>\n<p>I successfully went through the process with two extensions now:<\/p>\n<ul>\n<li>\n<a href=\"https:\/\/apps.apple.com\/us\/app\/service-worker-detector\/id1530808337?mt=12&amp;itscg=30200&amp;itsct=apps_box\">\n  Service Worker Detector\n  <div><img alt=\"Service Worker Detector extension icon\" width=\"64\" height=\"64\" src=\"https:\/\/github.com\/google\/service-worker-detector\/blob\/master\/assets\/icon-female-128.png?raw=true\"><\/div>\n<\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/apps.apple.com\/us\/app\/link-to-text-fragment\/id1532224396?mt=12&amp;itscg=30200&amp;itsct=apps_box\">\n  Link to Text Fragment\n  <div><img alt=\"Link to Text Fragment extension icon\" width=\"64\" height=\"64\" src=\"https:\/\/raw.githubusercontent.com\/GoogleChromeLabs\/link-to-text-fragment\/master\/assets\/icon.svg\"><\/div>\n<\/a>\n<\/li>\n<\/ul>\n<p>(Thanks to <a href=\"https:\/\/twitter.com\/xeenon\">Timothy Hatcher<\/a> who has been very helpful in navigating me through the process.)<\/p>\n\n\t\t\t<p>\n\t\t\t\t<img alt=\"Thomas Steiner\" width=\"32\" height=\"32\" src=\"https:\/\/blog.tomayac.com\/feed.php?dl=https%3A%2F%2Fblog.tomayac.com%2F2020%2F11%2F09%2Fsubmitting-and-distributing-a-safari-app-extension%2F&dp=%2F2020%2F11%2F09%2Fsubmitting-and-distributing-a-safari-app-extension%2F&dt=Submitting%20and%20Distributing%20a%20Safari%20App%20Extension\" alt=\"\">\n\t\t\t\t<br\/>This post appeared first on <a href=\"https:\/\/blog.tomayac.com\/2020\/11\/09\/submitting-and-distributing-a-safari-app-extension\/\">https:\/\/blog.tomayac.com\/2020\/11\/09\/submitting-and-distributing-a-safari-app-extension\/<\/a>.\n\t\t\t<\/p>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\t\t\tSafari 14 has<br \/>\nadded support<br \/>\nfor the<br \/>\nWeb Extensions<br \/>\nstandard,<br \/>\nwhich I consider a clever move on Apple&#8217;s side that deprecated Safari&#8217;s previous<br \/>\n.safariextz-style Safari extensions.<br \/>\nWhile there is great documentation for<br \/>\ncreating a Safari Web Extensio&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"intlwemo_wallet_address":"","footnotes":""},"categories":[],"tags":[],"class_list":["post-3345","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/posts\/3345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/comments?post=3345"}],"version-history":[{"count":3,"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/posts\/3345\/revisions"}],"predecessor-version":[{"id":3402,"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/posts\/3345\/revisions\/3402"}],"wp:attachment":[{"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}