ionic-push-notification

1.0.0 • Public • Published

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
});

Readme

Keywords

none

Package Sidebar

Install

npm i ionic-push-notification

Weekly Downloads

4

Version

1.0.0

License

none

Last publish

Collaborators

  • arnaudspanneut