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

feature(android): add support for badge count #207

Merged
merged 2 commits into from
Dec 1, 2016

Conversation

sondremare
Copy link
Contributor

Using Leolin's ShortcutBadger we are able to support any badge counts that are sent as part of the notifications data-payload.

@sondremare sondremare changed the title feature(android): add support for badge count (#1) feature(android): add support for badge count Nov 30, 2016
@evollu
Copy link
Owner

evollu commented Dec 1, 2016

great! any extra configuration needed?

@evollu
Copy link
Owner

evollu commented Dec 1, 2016

can you fix the conflicts?

Using Leolin's ShortcutBadger we are able to support any badge counts that are sent as part of the notifications data-payload.
@sondremare
Copy link
Contributor Author

Conflicts fixed.
It should not require any extra configuration. It will automatically respond to notifications that have badge in their data payload. Otherwise one can use the setBadgeNumber to manipulate the badge manually

@evollu evollu merged commit 62dce36 into evollu:master Dec 1, 2016
@evollu
Copy link
Owner

evollu commented Dec 1, 2016

will test and release

@sondremare
Copy link
Contributor Author

cool thanks :)

@evollu
Copy link
Owner

evollu commented Dec 1, 2016

@sondremare tried the function but no badge is showing up. Does it only work for specific system?
I'm using emulator with 6.0 BTW

@sondremare
Copy link
Contributor Author

Ah that should ofc been said. It works for specific vendors (LG, Samsung), as the code letting us draw this badge is part of the firmware. See https://github.com/leolin310148/ShortcutBadger

@malitta
Copy link

malitta commented Feb 16, 2017

@sondremare the documentation still states that it doesn't support badges in Android. Should this be changed or hasn't this feature been officially released yet?

@sondremare
Copy link
Contributor Author

@malitta I am just a contributor, so I am not sure. @evollu you have any information?

@evollu
Copy link
Owner

evollu commented Feb 16, 2017

I will change the readme

@nhuthan
Copy link

nhuthan commented Apr 28, 2017

(android) setBadgeNumber work but data-payload dont work
Here is my payload data:
{ collapse_key = "abc", data = new { badge = 10, }, time_to_live = 864000, //10 days notification = new { id = "id", color = "#66BB6A", title = "the title", body = "the content", icon = "ic_notification", priority = "high", show_in_foreground = true, content_available = true, badge = 10, sound = "default", }, registration_ids = [list id] };

What i am missing?

@sondremare
Copy link
Contributor Author

Try structuring your payload like this:

{
    collapse_key: 'abc',
    data: {
        badge: 10,
        more_stuff: more_values,
    },
}

@evollu
Copy link
Owner

evollu commented Apr 28, 2017

badge should be in notification payload

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

Successfully merging this pull request may close these issues.

4 participants