Book Image

Learning Ionic

By : Arvind Ravulavaru
Book Image

Learning Ionic

By: Arvind Ravulavaru

Overview of this book

Table of Contents (19 chapters)
Learning Ionic
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Ionic Push


You can add push notifications to your Ionic app by adding the Push plugin (https://github.com/phonegap-build/PushPlugin) and configuring it. Or you can use the push template from Ionic to do so:

ionic add ionic-service-core
ionic add ionic-service-push
ionic start myPushApp push
cd myPushApp
ionic plugin add https://github.com/phonegap-build/PushPlugin.git
ionic upload

Now, you can head back to the app.ionic.io page and click on the setting for the preceding app. In www/js/app.js, you will find the config section, which you can update with the values from the app settings page:

.config(['$ionicAppProvider', function($ionicAppProvider) {
  // Identify app
  $ionicAppProvider.identify({
    // The App ID for the server
    app_id: 'YOUR_APP_ID',
    // The API key all services will use for this app
    api_key: 'YOUR_PUBLIC_API_KEY'
  });
}])

Then, you can follow the Android Push setup guide (http://docs.ionic.io/v1.0/docs/push-android-setup) or the iOS push setup guide (http://docs.ionic.io/v1.0/docs/push-ios-setup) to implement the Push notifications.

Note

You can find more information about integrating push notifications to your app at http://docs.ionic.io/v1.0/docs/push-from-scratch.