ionic-push-notification

Ionic PushNotification Plugin =======

Usage no npm install needed!

<script type="module">
  import ionicPushNotification from 'https://cdn.skypack.dev/ionic-push-notification';
</script>

README

Ionic PushNotification Plugin

Build Status Coverage Status Code Climate

Provides a simple way to get the mobile API Key for Android and iOS. It's a wrapper for cordova push Notification Plugin.

Usage

In the browser

To use this plugin in the browser, include it in your HTML page:

<script src="ionic-pushNotification/dist/ionic-pushNotification.js"></script>

You can also download it from Bower:

bower install ionic-push-notification

API

Config

Overview

pushNotification.setConfig(config)

Set Plugin configuration for push initialisation.

Example:

myApp.config(function (pushNotificationProvider) {
  pushNotificationProvider
    .setConfig(config);
});

pushNotification.register()

Register the device. It call the classical push plugin init function. It return the push instance.

Example:

pushNotification.register().then(function (pushToken) {
  // Push token String
}).catch(function (err) {
  // an error
});

pushNotification.getDeviceToken()

Get the device push token of user when is registred.

Example:

pushNotification.getDeviceToken().then(function (pushToken) {
  // Push token String
}).catch(function (err) {
  // an error
});