Skip to content

Instantly share code, notes, and snippets.

@TmanTman
Created August 23, 2016 18:18
Show Gist options
  • Save TmanTman/148f7902992682b4796b1e9cb9d75151 to your computer and use it in GitHub Desktop.
Save TmanTman/148f7902992682b4796b1e9cb9d75151 to your computer and use it in GitHub Desktop.
Suggestion for Ionic 'ngCordova'-like wrapper for cordova-plugin-fcm
(function() {
angular
.module('fcm.plugin', [])
.factory('$FCMPlugin', $FCMPlugin);
$FCMPlugin.$inject = [];
function $FCMPlugin() {
var service = {
getToken: function(successCallback, failCallback) {
FCMPlugin.getToken(successCallback, failCallback);
},
onNotification: function(onNotification, onCallbackSuccesSet, onCallbackFailSet) {
FCMPlugin.onNotification(onNotification,
onCallbackSuccesSet, onCallbackFailSet);
}
};
return service;
}
})();
Copy link

ghost commented Aug 30, 2016

How to integrate it into an existing Angular/Ionic project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment