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

setBadgeNumber not working #124

Closed
michelsondan opened this issue Aug 30, 2019 · 8 comments
Closed

setBadgeNumber not working #124

michelsondan opened this issue Aug 30, 2019 · 8 comments
Assignees
Labels
android Relates to Android platform bug Something isn't working properly ignored issue template The reported ignored the issue template so required information may not be present investigate Issue requires investigation runtime issue An issue related to app runtime

Comments

@michelsondan
Copy link

I am trying to set badge with my app logic, and it is not working. it's reseting the current badge.

` window.FirebasePlugin.setBadgeNumber(myCount, function () {
alert('success')
},
function (err) {
alert(err)
})

the function is running and display the alert 'success' on done event, but the badge is not set to my request number.

@dpa99c
Copy link
Owner

dpa99c commented Aug 30, 2019

Please try building & running the example project to eliminate the cause of issue being in your own code.

If you are able to reproduce the issue in the example project, please complete the issue template to provide full details of the issue such as affected platform/version, etc.

@dpa99c dpa99c added awaiting response If no response, issue will be closed ignored issue template The reported ignored the issue template so required information may not be present runtime issue An issue related to app runtime support Support is being requested but not a necessarily a bug labels Aug 30, 2019
@michelsondan
Copy link
Author

I have tested it also with example project.
I see in log, that it is increment, but no badge number on app icon.
after sending push notification, I see the badge number set by system,
but after click on the button "Increment badge number", the badge is disappeared.

Screenshot_2019-08-30-15-52-52-166_il homely mls app
IMG_20190830_155449

Tested on Android Redmi Note 4
Android system NRD9OM 7.0

Thank You!

@dpa99c
Copy link
Owner

dpa99c commented Aug 30, 2019

OK, thanks for the info, I will add to list for investigation

@dpa99c dpa99c added bug Something isn't working properly investigate Issue requires investigation android Relates to Android platform and removed awaiting response If no response, issue will be closed support Support is being requested but not a necessarily a bug labels Aug 30, 2019
@dpa99c dpa99c self-assigned this Aug 30, 2019
@dpa99c
Copy link
Owner

dpa99c commented Sep 3, 2019

Upon investigation, the library used by this plugin to set the badge number on Android will not work on Android 8 and above.
As stated here, there's no way to programmatically set the badge number on Android 8+ without sending/displaying a notification.

Therefore I'm going to remove setBadgeNumber() and getBadgeNumber() from the Android implementation and make them iOS-only methods.

@dpa99c dpa99c closed this as completed in b826d1e Sep 3, 2019
@michelsondan
Copy link
Author

What is the logic of this? lot of time users entering to app by ignoring the popup notification, and the app should have the way to change the badge icon by internal logic that depend on user action.
this is bad.
must be a way.
Are all plugins not supporting badge?

@dpa99c
Copy link
Owner

dpa99c commented Sep 4, 2019

As the StackOverflow post I've referenced makes clear, there is no way to modify the badge icon count on Android 8 and above without displaying a notification.
However if you think there's a way to do this, please feel free to implement it and make a pull request to add the functionality to this plugin.

@michelsondan
Copy link
Author

This StackOverflow post don't seem to be Official answer.

@lwward
Copy link

lwward commented Oct 24, 2019

ShortcutBadger does work on a subset of Android devices and this change has broken existing uses of this plugin.

Surely it would be better to leave the Android functions in place while updating the README to explicitly say that is not supported on all Android devices?

adipascu added a commit to adipascu/cordova-plugin-firebasex that referenced this issue Jan 10, 2024
adipascu added a commit to adipascu/cordova-plugin-firebasex that referenced this issue Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Relates to Android platform bug Something isn't working properly ignored issue template The reported ignored the issue template so required information may not be present investigate Issue requires investigation runtime issue An issue related to app runtime
Projects
None yet
Development

No branches or pull requests

3 participants