Skip to content

Provide Extensibility to Include iOS Native Extensions in NativeScript Apps #4393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rosen-vladimirov opened this issue Feb 25, 2019 · 3 comments
Assignees

Comments

@rosen-vladimirov
Copy link
Contributor

rosen-vladimirov commented Feb 25, 2019

Is your feature request related to a problem? Please describe.
As a user, I would like to add App Extensions to my NativeScript application for iOS. For example, I would like to use Share extension, Today widget, etc.
More information for the extensions can be found here: https://developer.apple.com/app-extensions/

Describe the solution you'd like
Allow using native iOS Extensions in NativeScript app, i.e. place their source code (Objective-C) under source control, for example in App_Resources directory.

parent to #4391
parent to #3965

@tdhman
Copy link

tdhman commented Mar 19, 2019

Hello,

I also run into this issue then by following the post nativescript-ios-imessages, I'm able to add the share extension into iOS project by adding the application source code and write the extension's view controller in Nativescript js (as described in the post above).

However, I would like to reuse a module / function from the main application target to do the sharing task without recoding the function (or create a native code extension) because I have already coded all the logic code in js with some Nativescript plugins.
I'm using NativeScript-Vue and since it compile & bundle all js source code, I cannot simply re-import the necessary module in bundle.js / vendor.js to use in my js share extension (this is another issue).

Hence, I would like to suggest that NativeScript-Cli could also support the share extension written in js like the example above but instead of manually adding the share extension target after tns build in Xcode, it would be great if the cli can automatically generate the extension target from the extension folder, e.g. from the App_Resources, place the extension code in a folder with a json file that describes the extension's name, controller, etc.

As I see, @KristianDD is currently implementing the iOS extension support for native code extension #4472, I wonder if you could add support the extension in js also ?

@KristianDD
Copy link
Contributor

Hi @tdhman ,
The feature for using NativeScript framework inside the extension is still under consideration. The main reasons for that are the limitations that iOS App Extensions have. One of the main ones is the memory limitation, which once exceeded will just kill the extension process runtime. Each extension has different memory footprint limitation, but we still need to investigate in which extensions we have enough room for running the runtime. In this Stack Overflow thread you can read about some cases where developers had hit the memory limit with pure native extensions.

The other issue is that extensions have strict limitations to which APIs they can access. Same restrictions apply to frameworks embedded inside the extension target. Reference here.

Will update you once we have more information on the status of this feature.

@miroslavaivanova miroslavaivanova removed this from the 5.3.0 milestone Apr 10, 2019
@KristianDD
Copy link
Contributor

Logged a separate issue for research of embedding NativeScript framework in iOS App Extensions. Closing this issue as the feature it describes is already finished and released.

@ghost ghost removed the planned label Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants