I’m writing an app with Cordova, Ionic v1 and AngularJS.
I want to implement push notifications in my app and I have considered using this plugin. I see the documentation for Ionic 3 & 4.
I was able to get this working on a plain JS project with cordova but not yet with the Ionic 1 & AngularJS integration.
I get undefined from the window object.
How can I access this plugin from within the AngularJS context?
console.log(window);
//do the push notifications here
console.log(window.FirebasePlugin); //undefined
console.log($window.FirebasePlugin); //undefined
// window.FirebasePlugin.getToken(function(fcmToken) { //undefined
// console.log(fcmToken);
// }, function(error) {
// console.error(error);
// });
// $window.FirebasePlugin.getToken(function(fcmToken) { //undefined
// console.log(fcmToken);
// }, function(error) {
// console.error(error);
// });
Here is my code: https://github.com/aquinn637/IonicPushTest