Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hybrid Mobile Development with Ionic

You're reading from   Hybrid Mobile Development with Ionic Building highly interactive mobile apps

Arrow left icon
Product type Paperback
Published in Apr 2017
Publisher Packt
ISBN-13 9781785286056
Length 242 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Gaurav Saini Gaurav Saini
Author Profile Icon Gaurav Saini
Gaurav Saini
Arrow right icon
View More author details
Toc

Offline currency converter PWA

We have looked into what exactly PWA and service-workers are, now let's build a PWA application using Ionic. We will be implementing an offline currency converter, which according to the network state fetches the latest data from fixer.io or from the cache or storage data. The application will have a listing of currency conversion rates according to base currency.

Firstly, we will start a new Ionic 3 application using Ionic CLI and install the NPM package for @ionic/storage:

$ npm install --save @ionic/storage

We will be running it using Ionic serve, which will host it on the 8100 port. Now as discussed in our last section, we will uncomment the service worker code in the index.html file in the src folder.

In our application, we have mainly two views, HomePage and ListPage. Other than that we will be using two provider classes, currency-service and storage-service, for calling...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime