Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using plugin in Ionic v3 #132

Open
adboio opened this issue Mar 12, 2019 · 1 comment
Open

Error using plugin in Ionic v3 #132

adboio opened this issue Mar 12, 2019 · 1 comment

Comments

@adboio
Copy link

adboio commented Mar 12, 2019

I'm not 100% sure if this is an issue with the Badge plugin or with Ionic, but...

I’m trying to set notification badges on my app, but for some reason it’s not working. Right now I just have a button for testing that, when clicked, runs this function:

setBadge() { try { this.badge.set(10); } catch (e) { console.error(e); } }

When this function is called an error is caught reading:
ERROR: {"line":54169,"column":126,"sourceURL":"http://localhost:8080/build/vendor.js"}

That line in vendor.js is:

Badge.prototype.set = function (badgeNumber) { return Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordova"])(this, "set", {}, arguments); };

I’ve got Badge imported like this, as per Ionic docs:
import { Badge } from '@ionic-native/badge/ngx';
...and it was installed using ionic cordova plugin add cordova-plugin-badge

and have added Badge to my app.module.ts file.

Any ideas on what might be causing this? The same error appears for all Badge methods, with corresponding lines in the vendor.js file.

Currently testing on an iPhone 8+ with iOS 12.1.2.

@ClaudineiOlSantos
Copy link

Não tenho 100% de certeza se isso é um problema com o plugin Badge ou com o Ionic, mas ...

Estou tentando definir os crachás de notificação no meu aplicativo, mas, por algum motivo, não está funcionando. Agora eu só tenho um botão para testar que, quando clicado, executa esta função:

setBadge() { try { this.badge.set(10); } catch (e) { console.error(e); } }

Quando esta função é chamada, um erro é detectado lendo:
ERROR: {"line":54169,"column":126,"sourceURL":"http://localhost:8080/build/vendor.js"}

Essa linha no vendor.js é:

Badge.prototype.set = function (badgeNumber) { return Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordova"])(this, "set", {}, arguments); };

Eu tenho o Badge importado assim, de acordo com documentos iônicos:
import { Badge } from '@ionic-native/badge/ngx';
... e ele foi instalado usandoionic cordova plugin add cordova-plugin-badge

e adicionei o Badge ao meu arquivo app.module.ts.

Alguma idéia sobre o que pode estar causando isso? O mesmo erro aparece para todos os métodos Badge, com linhas correspondentes no arquivo vendor.js.

Atualmente testando em um iPhone 8+ com o iOS 12.1.2.

Sorry for my english translator.
In my case I had imported the version of ionic 4, I uninstalled the plugin and installed again with the correct version of ionic. worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants