Book Image

Ionic 2 Cookbook - Second Edition

By : Hoc Phan
Book Image

Ionic 2 Cookbook - Second Edition

By: Hoc Phan

Overview of this book

Developing real-time apps is the need of the hour, and apps that deal with humongous amounts of user data and real-time information that needs to be updated frequently are in high demand. Currently, one of the most popular frameworks for this task is Ionic Framework, which is undergoing a major makeover. This book will get you started with Ionic and help you create Angular 2 components that interact with templates. From there, you’ll work with Ionic components and find out how to share data efficiently between them. You’ll discover how to make the best use of the REST API to handle back-end services and then move on to animating the application to make it look pretty. You’ll learn to add in a local push notification in order to test the app. You’ll work with Cordova to support native functionalities on both iOS and Android. From there, you’ll get to grips with using the default themes for each platform as well as customizing your own. Finally, you’ll see how best to deploy your app to different platforms. This book will solve all your Ionic-related issues through dedicated recipes that will help you get the best out of Ionic.
Table of Contents (16 chapters)
Ionic 2 Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Viewing the app using Ionic View


Ionic View is an app viewer that you can download from the App Store or Google Play. When you are in the development process and the app is not completed, you don't want to submit it to either Apple or Google right away but limit access to your testers. Ionic View can help load your own app inside Ionic View and make it behave like a real app with some access to native device features. Additionally, Ionic View lets you use your app on an iOS device without any certificate requirement.

Since Ionic View uses Cordova InAppBrowser plugin to launch your app, all the device features have to be hacked to make it work. Currently, Ionic View only supports SQLite, battery, camera, device motion, device orientation, dialog/notification, geolocation, globalization, network information, vibration, keyboard, status bar, barcode scanner, and zip. It's a good idea to check the updated support list prior to using Ionic View to ensure that your app works properly.

How to do it…

There are two ways to use Ionic View. You can either upload your own app or load someone else's app ID. If you test your own app, follow these steps:

  1. Download Ionic View from either App Store or Google Play.

  2. Make sure to register an account on ionic.io.

  3. Go to your app's project folder.

  4. Search for ionic upload.

  5. Enter your credentials.

  6. The CLI will upload the entire app and give you the app ID, which is 152909f7 in this case. You may want to keep this app ID to share with other testers later.

  7. Open the Ionic View app on the mobile device and log in if you haven't done so already.

  8. Now you should be able to see the app name on your MY APPS page. Go ahead and select the app name (myApp in this case), as illustrated:

  9. Select VIEW APP to run the app, as shown:

  10. You will see that the app interface appears with initial instructions on how to exit the app. Since your app will cover the full screen of Ionic View, you need to swipe down using three fingers, as illustrated, to exit back to Ionic View:

If there is no code update, the process is the same except that you need to select SYNC TO LATEST from the menu.

There's more…

To summarize, there are several benefits of using Ionic View, some of which are as follows:

  • It's convenient because there is only one command line to push the app

  • Anyone can access your app by entering the app ID

  • There is no need to even have iOS developer membership to start developing with Ionic. Apple has its own TestFlight app, in which the use case is very similar

  • You can stay agile in the developer process by having testers test the app as you develop it

  • Ionic View has a wide range of device feature support and continues to grow