I have an app in Angular 5 with Ionic 3, and I'm trying to use notifications with the phonegap-plugin-push plugin, initially only for ANDROID. The project correctly executes both in the browser (ionic serve) and in android (--release and --prod) It also successfully completes the ionic: build --prod.
But notifications do not work as expected.
As soon as the first step, which is to verify that the app has permission for Push Notification, already returns an error, described below.
When I run ionic cordova run android --device --debug orionic serve and enter the page with notification code, I saw that nothing happened. Do not even catch.
Accessing the browser's browser mode, putting breakpoint and browsing methods, I realized that:
1) this.push na página onde é chamado tem o seguinte valor:
2) Pressing F11, in the hasPermission () method you have:
Push.prototype.hasPermission = function () { return cordova(this, "hasPermission", {}, arguments); };
3) Passing the mouse over the 'Push.prototype.hasPermission', I find the error:
Uncaught ReferenceError: Push is not defined
at eval (eval at Push.hasPermission (index.js:39), <anonymous>:1:1)
at Push.hasPermission (index.js:39)
at new ListagemPropostasPage (listagem-propostas.ts:81)
at createClass (core.js:12174)
at createDirectiveInstance (core.js:12011)
at createViewNodes (core.js:13449)
at createRootView (core.js:13339)
at callWithDebugContext (core.js:14740)
at Object.debugCreateRootView [as createRootView] (core.js:14041)
at ComponentFactory_.create (core.js:10960)
I've already tried on a real device and the error persists. And from there, I can not go on. Push not being set, it will not allow me to move forward.
Hello! Good night! I would like your help.
I have an app in Angular 5 with Ionic 3, and I'm trying to use notifications with the phonegap-plugin-push plugin, initially only for ANDROID. The project correctly executes both in the browser (ionic serve) and in android (--release and --prod) It also successfully completes the ionic: build --prod. But notifications do not work as expected.
As soon as the first step, which is to verify that the app has permission for Push Notification, already returns an error, described below.
I'm trying to use this plugin: https://ionicframework.com/docs/native/push
I already registered in firebase, copied the key, downloaded and put the file
google-services.json
Module:
Page:
Package.json
Config.xml
When I run
ionic cordova run android --device --debug
orionic serve
and enter the page with notification code, I saw that nothing happened. Do not even catch.Accessing the browser's browser mode, putting breakpoint and browsing methods, I realized that:
1)
this.push
na página onde é chamado tem o seguinte valor:2) Pressing F11, in the
hasPermission ()
method you have:Push.prototype.hasPermission = function () { return cordova(this, "hasPermission", {}, arguments); };
3) Passing the mouse over the 'Push.prototype.hasPermission', I find the error:
I've already tried on a real device and the error persists. And from there, I can not go on. Push not being set, it will not allow me to move forward.
Can you help me?
Sorry my english ...
Thank you