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

neither setDefaults or configure apis are working any way possible #490

Open
gzbakku opened this issue Dec 9, 2019 · 5 comments
Open

neither setDefaults or configure apis are working any way possible #490

gzbakku opened this issue Dec 9, 2019 · 5 comments

Comments

@gzbakku
Copy link

gzbakku commented Dec 9, 2019

neither of the given api's are changing the notification text title or color

i implemented the plugin like this

cordova.plugins.backgroundMode.enable();
cordova.plugins.backgroundMode.configure({
  title: 'live on aaa',
  text:'close the app if you want to go offline on your aaa account.',
  color: 'ff0829',
  resume: true
});

cordova.plugins.backgroundMode.setDefaults({
  title: 'live on aaa',
  text:'close the app if you want to go offline on your aaa account.',
  color: 'ff0829',
  resume: true
});
cordova.plugins.backgroundMode.enable();

please guide us how to use it you are great

@danieltanasec
Copy link

I am facing the same issue on Android 9.1. I have tried both setDefaults() and configure() before and after backgroundMode.enable() or backgroundMode.on('activate').subscribe() but no luck unfortunately

@amn31
Copy link

amn31 commented Dec 13, 2019

Same issue if I create my project wich 9.0.0 (cordova-lib@9.0.1)

@RobertY9
Copy link

I was having the same issue, it appears that if a notification does not have a valid icon it ignores all of the defaults and doesn't work.

example here

@danieltanasec
Copy link

@gzbakku , @RobertY9 I confirm that I also solved the issue in the same way. The method getIconResId() in foreground service returns an error.

@grumpygary
Copy link

grumpygary commented Feb 12, 2020

All settings must be valid or it will fail:

  • You need an icon on Android for the notification (omit the ".png", and it must be in the folder mentioned)
  • If you include a color, omit the "#"

I'm pretty sure silent mode will fail. As a user, I like knowing that an app is running in the background.

BTW, from what I can tell, this plugin is really only useful for immediately resuming a session, instead of a cold-start. That said, that was what I was looking for at this point. It would be nice if I could do more things in the background, but such is the world of cordova open-source...

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

5 participants