1.0.0 • Published 9 years ago

ionic-push-notification v1.0.0

Weekly downloads
1
License
-
Repository
github
Last release
9 years ago

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