{"action":"opened","issue":{"url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/3965","repository_url":"https://api.github.com/repos/NativeScript/nativescript-cli","labels_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/3965/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/3965/comments","events_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/3965/events","html_url":"https://github.com/NativeScript/nativescript-cli/issues/3965","id":365905945,"node_id":"MDU6SXNzdWUzNjU5MDU5NDU=","number":3965,"title":"Feature Request: Support for iOS app extensions","user":{"login":"mbektchiev","id":5744783,"node_id":"MDQ6VXNlcjU3NDQ3ODM=","avatar_url":"https://avatars1.githubusercontent.com/u/5744783?v=4","gravatar_id":"","url":"https://api.github.com/users/mbektchiev","html_url":"https://github.com/mbektchiev","followers_url":"https://api.github.com/users/mbektchiev/followers","following_url":"https://api.github.com/users/mbektchiev/following{/other_user}","gists_url":"https://api.github.com/users/mbektchiev/gists{/gist_id}","starred_url":"https://api.github.com/users/mbektchiev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbektchiev/subscriptions","organizations_url":"https://api.github.com/users/mbektchiev/orgs","repos_url":"https://api.github.com/users/mbektchiev/repos","events_url":"https://api.github.com/users/mbektchiev/events{/privacy}","received_events_url":"https://api.github.com/users/mbektchiev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-02T13:47:20Z","updated_at":"2018-10-02T13:47:20Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"**Description**\r\n\r\niOS App Extensions are the iOS way of enabling some of the rich native app experiences. For more info see the [App extensions documentation page](https://developer.apple.com/app-extensions/)\r\n\r\n**Describe the solution you'd like**\r\nCLI should be able to:\r\n* Add targets with their dependent files\r\n* Embed the new extension targets’ products in the app target\r\n* Allow each target to optionally reference NativeScript.framework. Note: WatchKit Apps can no longer support that after version 2.0 of watchOS. \r\n* Provide ability to control behavior via additional keys in `package.json`\r\n\r\n**Describe alternatives you've considered**\r\nThere are a couple of rather outdated proof-of-concept implementations with Today widgets available:\r\n    * https://www.nativescript.org/blog/making-a-today-widget-in-ios-with-nativescript-and-ui-for-nativescript\r\n    * https://github.com/NativeScript/ios-runtime/tree/master/examples/TodayExtension\r\n\r\nThey require manual changes to the Xcode project `platforms/ios` which is undesirable. The `platforms` directory is considered ephemeral -- it shouldn’t be committed in source control and should be eligible for safe deletion at any time.\r\n\r\n**Additional context**\r\n* By following the Today widget article, JavaScript code will be duplicated in both the app and the extension. When `tns_modules` is big this could significantly bloat the app package size. To solve this we could make the extension directory in `App_Resources` have its own `package.json` – this can potentially reduce the amount of duplicated modules.\r\n* There’s a way to enable resource sharing between the two bundles. It might be better suited in order to avoid the above-mentioned duplication: https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW6 \r\n* If the extension and the app don’t need to share common JS logic it might be better to not refer NativeScript.framework and implement the logic entirely in Swift and/or ObjectiveC. These extensions are iOS specific and they can’t share code with other platforms (Android). Another great benefit will be that Xcode’s built-in tooling for UI and code writing could be used for developing them."}}
{"actor":{"display_login":"mbektchiev"}}