cordova-shims_services_notifications Module
Service that allows for registration/unregistration and handling of push notifications received from GCM or APNs.
Configuration and setup of the service is done in an initializer:
import NotificationsService from 'cordova-shims/services/notifications';
export function initialize(container, application) {
let service = NotificationsService.create({
gcmSenderId: '{INSERT-KEY-FROM-GCM-HERE}',
gcmTimeout: 10000 // Timeout for GCM in ms. Default: 15000
});
application.register('service:notifications', service, {
instantiate: false
});
application.inject('route', 'notifications', 'service:notifications');
}
export default {
name: 'notifications-service',
initialize: initialize
};
This module provides the following classes: