Can I use the native JAVA/SWIFT code in NativeScript? I want to store the cookies into the cookie manager, but there is no plugin provided. So, is that possible to use the native code directly into NativeScript or I've to create a plugin myself for this task.n
1 Answer
The answer is yes. You can write with native (iOS & Android) language in NativeScript which is the biggest benefit of the {N} framework but you can use Objective-C and Java not so sure about Swift (there are some ways to do so read here). I would recommend you to read this articles regarding the iOS and Android runtimes in NativeScript:
- iOS runtime: http://docs.nativescript.org/runtimes/ios/Overview.html
- Android runtime: http://docs.nativescript.org/runtimes/android/overview.html
Here are some examples:
- iOS Hello World app: http://docs.nativescript.org/runtimes/ios/getting-started/HelloWorld.html
- Android Hello World app: http://docs.nativescript.org/runtimes/android/getting-started/hello-world.html
4 Comments
Raghavendra Shivhare
is that the examples where we can use self created classes into NativeScript?
Vladimir Amiorkov
Please take a look at the full documentation here: docs.nativescript.org/runtimes/ios/Overview.html , you will find docs.nativescript.org/runtimes/ios/how-to/ObjC-Subclassing.html and docs.nativescript.org/runtimes/ios/how-to/… and many more resources regarding how to use native code in NativeScript.
Vladimir Amiorkov
If this is not what you are after I suggest you to edit your initial post to indicated what exactly you are asking and trying to do.
Raghavendra Shivhare
I was trying to find the
tns-android (as described in the link you shared for android earlier) but couldn't find that, do you've any idea where to use that folder.