Prepare for native iOS and Android api intellisense with NativeScript

Nathan Walker
InstructorNathan Walker

Share this video with your friends

Send Tweet
Published 5 years ago
Updated 3 years ago

To prepare your development environment to code against native apis such as Objective C, Swift and Java, let's learn how to install tns-platform-declarations to provide rich intellisense support for all the native iOS and Android api’s. This lesson will cover how to modify your tsconfig.json and references.d.ts properly to ensure working with native api’s is smooth and as helpful as possible.

[00:00] Let's install the tns-platform-declarations, and let's save that to our devDependencies. Now we need to make a few modifications to our tsconfig. Let's reference the ES2016 library and then modify our references.

[00:19] NativeScript's core engineering team has provided some excellent examples on great project setup, and we'll use their references here and we'll set these up. You can see it references ES2016 tns-core-modules in the iOS and Android platform declarations. With this installed, you now get rich IntelliSense support on things like UI application, the shared application instance, key window.

[00:45] And in fact, you can go to Apple's API reference documentation and just browse the API that's now opened up to you. You'll find a rich set of classes in APIs. Things like NSNotificationCenter, where you can grab an instance of the default center and actually send events out -- which is kind of like Objective-C's EventBus system -- and access the APIs from, for instance, UI kit, which provides a rich API to say, for instance, the UI video controller.

[01:15] And just like you can browse Apple's API reference for Objective-C, you can browse Android's API reference for Android, where you have access to things like the Android Media Package -- where you can get access to the media player -- or Android's location package, where you have access to things like the Geocoder.

[01:37] Having this setup will help you dramatically in coding against native APIs, be it for iOS or Android.

hainakus
hainakus
~ 4 years ago

Hi Richard for IOS Dev account for android no need for mac device. Great tutorial.