-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Changing the notification info not working #506
Comments
I second that. Is there something wrong with the plugin? |
Same here.... the notification parameters couldn't be changed even if I edited the Java code... What the heck?? :-O |
FOUND the solution: you have to define the icon name, which you first should create (add new image asset in Android Studio). When I don't define the icon, the notification will be generated with the default data.... |
wow, I tried to solve this for a while, you helped a lot, now it's working! |
So @ragcsalo , do we define the icon in the object below after creating the image? cordova.plugins.backgroundMode.setDefaults({ title: "helo", text: "Text", icon: 'icon', color: "F14F4D", resume: true }) |
Hi @kevdaci, You can use any icon, even those that are already there ... |
Thanks! finally it works!! |
@rodrigoti @ragcsalo @Taxi4you Could you provide an explicit example? I cannot get it to work... i still get the default notification that brings to the 'app info' setting page instead of bringing the app back up! Something is off i guess: Does the color need the "#" before the hex digits like in css? do i need to add the extension (.png) to the icon name? does it have to be ldpi or hdpi? this is confusing for newbies who do not know what you are talking about exactly... Readme is lacking in explicit details at https://github.com/katzer/cordova-plugin-background-mode#override-defaults ... oh well, ill try more stuff in the meantime and report back here! Thanks in advance! :) |
@kevdaci Can you be more specific? newbie here who does not understand what's what and where do files go/extension.png needed? etc... you seem to have a solution as others say 'thanks' but I cant make out what all of that means! |
@boltex In your project directory of Ionic there should be a platforms folder. In that folder you should see an android folder (so basically ./platforms/android). Open that android folder using Android Studio. Once you opened the android project in Android Studio, if you look at the project side panel there should be a res folder. Right click on it and then click on New>Image Asset. A Configure Image Asset window should popup. Change the Name field to "icon", and then keep on clicking next. Build the ionic project as you usually would, and now you should click on the notification that would take you to the app instead of taking you to the information stuff. Please let me know if this works. Now, I do not know how to change the default image, so you might have to do research on that, and tell me how to do that :) . |
@kevdaci
I'm just using cordova and the terminal window, no android studio IDE. Many thanks again! |
@boltex you must use without the .png extension this.backgroundMode.setDefaults({ if you want to change the icon, add an icon to all folders mipmap-hdpi |
This and the one done by me:
i put the ic_launcher image in all folders: but it still doesn't work. |
@massimilianocom remember to put .png extension on the image file on disk tho. |
ok I managed to get it working, I wanted to ask how text could I also insert html tags? |
I am writing this:
But when minize the app, I see the default OS notification info and when click on it it moves to app settings instead of just open it.
Android any device.
Plugin version: 0.7.3
The text was updated successfully, but these errors were encountered: