Book Image

Getting Started with Ionic

By : Rahat Khanna
Book Image

Getting Started with Ionic

By: Rahat Khanna

Overview of this book

Hybrid Apps are a promising choice in mobile app development to achieve cost effectiveness and rapid development. However, they were not preferred over native apps until few years back due to a poor performance and bad user experience, but everything has changed with the release of Ionic. It has evolved as the most popular choice for Hybrid Mobile App development as it tends to match the native experience and provides robust components/tools to build apps. Getting Started with Ionic equips any web developer with the basic knowledge needed to use modern web technologies to build amazing hybrid mobile apps using Ionic. This fast-paced, practical book explains all the important concepts of AngularJS and Cordova Framework required to develop apps, then gives you a brief introduction to hybrid mobile applications. It will guide you through setting up the environment to develop mobile apps, and through the multiple options and features available in Ionic so you can use them in your mobile apps. Features such as the Side Menu, Tabs, Touch Interactions, and native features such as Bar Code, Camera, and Geolocations are all covered.. Finally, we’ll show you how to use Cordova plugins and publish your apps.
Table of Contents (17 chapters)
Getting Started with Ionic
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Custom Cordova plugin development


There are multiple third-party open source plugins available that can be integrated to your Ionic App along with the ngCordova library. If we do not find the required functionality plugin, we can develop a custom Cordova plugin and use it along with the ngCordova library.

We have to write the native code for each platform we want to port our plugin on. The native coding part will be standard according to the procedures followed in the respective native platform. Cordova helps in exposing the same functionality using the native hybrid bridge. In your JavaScript file, you should call the following method to invoke the native functionality:

cordova.exec(successCallback, failureCallback, service, action, [args]);

The previous code will execute/invoke the action method on the service class on the native side. If the native code completes successfully, it will call the successCallback or, if it fails, it will call failureCallback. The detailed process to develop...