{"id":10362,"date":"2014-12-21T15:18:09","date_gmt":"2014-12-21T20:18:09","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=10362"},"modified":"2014-12-21T15:18:09","modified_gmt":"2014-12-21T20:18:09","slug":"open-url-from-today-extension","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2014\/12\/21\/open-url-from-today-extension\/","title":{"rendered":"Open URL From Today Extension"},"content":{"rendered":"<p><a href=\"http:\/\/indiestack.com\/2014\/12\/open-url-from-today-extension\/\">Daniel Jalkut<\/a>:<\/p>\n<blockquote cite=\"http:\/\/indiestack.com\/2014\/12\/open-url-from-today-extension\/\">\n<p>A friend of mine mentioned in passing that he was having trouble getting an obvious, well-documented behavior of his Today extension to work &#8230; as documented. <a href=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/General\/Conceptual\/ExtensibilityPG\/NotificationCenter.html#\/\/apple_ref\/doc\/uid\/TP40014214-CH11-SW1\">According to Apple<\/a>, a Today extension should use NSExtensionContext when it wants to open its host app, e.g. to reveal a related data item from the Today widget, in the context of the host application.<\/p>\n<p>[&#8230;]<\/p>\n<p>So Apple&rsquo;s Calendar widget, at least, is not using -[NSExtension openURL:completionHandler:]. It&rsquo;s using plain-old, dumb -[NSWorkspace openURL:]. And when I change my sample Today extension to use NSWorkspace instead of NSExtensionContext, everything &ldquo;just works.&rdquo;<\/p>\n<\/blockquote>\n<p>I ran into this with <a href=\"http:\/\/c-command.com\/eaglefiler\/\">EagleFiler<\/a> and ended up using <code>NSWorkspace<\/code> as well.<\/p>","protected":false},"excerpt":{"rendered":"<p>Daniel Jalkut: A friend of mine mentioned in passing that he was having trouble getting an obvious, well-documented behavior of his Today extension to work &#8230; as documented. According to Apple, a Today extension should use NSExtensionContext when it wants to open its host app, e.g. to reveal a related data item from the Today [&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":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","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":[131,905,30,111,71],"class_list":["post-10362","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-bug","tag-extensions","tag-mac","tag-notificationcenter","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10362","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=10362"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10362\/revisions"}],"predecessor-version":[{"id":10363,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10362\/revisions\/10363"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=10362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=10362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=10362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}