Short answer
With Ionic you are building hybrid apps or Progressive Web Apps. The structure of the app is written in HTML and the built app is using WebViews (something like a website inside your app).
With NativeScript you are building truly native apps that do not use the HTML DOM and you'll have to learn the UI components of the platform you are targeting (e.g. iOS/Android). However, native apps are usually faster than hybrid apps and you can access the hardware features like camera, touch, calendar, phone calls, etc. all with TypeScript/JavaScript code.
Long answer
Here's an extract of a blog post by Danyal Zia. I suggest you read the complete one.
Ionic (2)
Ionic 2 is a hybrid mobile development framework… okay, so what does it mean by hybrid development? Hybrid apps are like any other apps you can find on the app stores, they run in the same manner (by downloading and installing them), and the user interaction is similar, in fact, most users hardly realize the difference between native apps and hybrid apps.
The interesting thing about hybrid apps is that they are hosted inside a native application which uses the WebView – which is kind of browser-less web pages loader, so you get access to mobile functionalities, such as, camera, contacts, gyroscope, etc. through website languages, like HTML, XML, CSS, etc.
Ionic 2 still uses WebView (just like the previous Ionic version), so you write the HTML code in your Android activities, so it can be slower compared to ReactNative and NativeScript (we will talk about it later). You can create native looking widgets in Ionic 2, but they are still rendering in WebView inside a native container, and so are not technically native.
Pros:
- Hybrid web development support. Same code-based can be used to
develop applications for Android, iOS, Windows Phone, and web.
- VERY fast development-testing cycle. You write the code and test it on the
browser, no need for heavy emulator loading.
- Allow you to write code in TypeScript, making the transition from Angular 2 very easy.
- The same language (TypeScript) can be used to develop applications for
every platform.
- Its plugin system makes it available for you to use
any kind of native functionalities of devices.
Cons:
- Performance issues may occur if you need to use a lot of callbacks to the native code.
- The same UI look in all the devices may be a deal breaker for those who prefer the native UI look.
- Development of highly advanced graphics or highly interactive transitions can be a complex job.
NativeScript
Developed by Telerik, NativeScript allows you to use either JavaScript or TypeScript for the development, so if you have used Angular 2 earlier, then you will have an easy transition. Telerik previously developed Kendo UI with tight Angular integration for the hybrid apps, but they later realized, why not provide the true cross-platform native experience?
With TypeScript and Angular 2, you can very easily create components for mobile apps using a declarative style. Claiming to support “write it once, run it everywhere”, the same Angular 2 code can be utilized for the UI for all the platforms it is targeting. NativeScript is a real cross-platform, which means 100% Native API access and its mission is to allow people to use the same code-base for all the platforms.
Unlike ReactNative, NativeScript uses the native UI code (for respective Android and iOS phones) even though you are writing the code in TypeScript/JavaScript! If we consider the performance side, then NativeScript really has the edge over ReactNative, because it is using AngularJS 2 structure for creating components.
The best thing about NativeScript is that it is developed by Telerik which assures you that it will keep receiving new updates in the future, as it is backed by professional developers all around the world. So, if you are using commercial applications, you can rely on NativeScript more than ReactNative, as ReactNative is more open-source friendly and relies a lot of contributions from the users. But, NativeScript is also open-source.
NativeScript is also quite matured compared to ReactNative. It is already in 2.0 version, that’s not the case with ReactNative which gets new updates less often. NativeScript can share much more code than ReactNative, meaning it will save your time.
Pros:
- Real cross-platform support. Single code-base for developing apps for all the supported platforms.
- 100% Native API access. You can access the hardware features like camera, touch, calendar, phone calls, etc. all with TypeScript/JavaScript code.
- Uses the Angular 2 so you can easily transfer your previous web components in your applications.
- Very good support from Telerik.
Cons:
- Many plugins need to be downloaded separately for the components. Not all plugins are available or verified (i.e., thoroughly tested).
- App size is much larger than ReactNative and Ionic 2. If your users have slow internet connection, then it may be a problem for you.
- There’s no support of HTML and DOM in NativeScript, so you need to learn different UI components to build UI of the applications.