-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Samsung running Android 8 is reported as supported, but is not #266
Comments
Note that the DefaultBadger also must check for Samsung on Android 8, or it will be used on those devices. This fixes leolin310148#266
I have now submitted a pull request, #268, as my suggestion to how to fix this. |
Just a clarification: On Samsung Galaxy S8 with Android 8.0, badges are still supported, but not by the same API as before, and it behaves differently. Users can configure the "app icon badges" in the "Home screen settings". Users can choose to turn off badges, to show them without number, or show them with a number. This is a global setting for all apps, and app developers (such as us users of ShortcutBadger) can not override this. In addition, badges can be disabled per app in the app settings. Badges are only shown while there are visible notifications for the app. The number shown (if enabled by the user) is either the number of visible notifications, or the value set in the notification API method And to be clear: In my opinion, I don't think this new way of adding app icon badges should be a part of the ShortcutBadger API. When creating notifications, app developers should always call |
@eirikwah i have a same problem. But i can't understand how you solve this. Please help me. Thank you |
@canberkcakmak, you can see my suggested fix at the pull request #268. However, if you do not want to build a fork of ShortcutBadger, the fix is simply this wrapper code:
As for applying badges from your notifications, see the Android documentation, and note the section "Set custom notification count". |
I don't have a Samsung device to test this, but I have to ask(Running a Nexus right now). Will Nova Launcher(with Tesla unread) now not work on Samsung Oreo devices with this update? I need to read more of the code but I'm assuming the answer is yes it works fine. EDIT: I support this assuming it doesn't break Nova Launcher(and other install able launchers). |
I do have a Samsung Galaxy S8 running Oreo, but I don't want to buy "Nova Launcher Prime" to test badges. I did test "Nova Launcher" (the free version), and this does not support badges on Samsung Galaxy S8 running Oreo. (I did the testing without the pull request #268 applied). |
@eirikwah for Android 8, if the app has active notifications, there will be count on the launch icon. Will your fix just replace that count with your own. Or you do combine them together? Update: It looks like the new badge will replace the original one by the system. |
One alternative way is to create a low importance notification channel and set the |
@eirikwah so what are users of Ionic 3/4 (inherently using https://github.com/katzer/cordova-plugin-badge plugin) supposed to do because they don't have a choice to just use setNumber()? Do we just need to wait for an update to ShortcutBadger? But you say it shouldn't even be a part of the ShortcutBadger API... This is a pressing issue right now for Ionic developers deploying to the newest Android versions in the market. |
Hi, @Harmonickey. I am not familiar with Cordova nor Ionic, so this is a generic answer: It seems that @leolin310148 or other contributors have not had the time to update this project in a while. I myself have not forked this project and created any new release, as I did find a workaround that worked for my project (see my previous comments). However, is not a big problem that the fix is not merged into the main branch and released, as this is open source. :-) I suggest that you fork this project (feel free to include my pull request and/or code from the previous comments on this issue). Then you can include these changes in Cordova by following the guide they have written at https://github.com/katzer/cordova-plugin-badge#contributing . Sorry for (probably) not giving you the answer you were looking for. I hope things work out for your project. |
@eirikwah no worries, I appreciate the thoughtful response. I give your suggestions a try. |
@eirikwah |
Tested on Samsung Galaxy S8 running Android 8.0 (Oreo).
Calling
ShortcutBadger.isBadgeCounterSupported(context)
returns true, but setting the badge has no effect. (This worked correctly before updating from Android 7.1 to Android 8.0.)It seems that the Samsung launcher on Android 8.0 rather uses the normal Android 8 function for badges instead (coupling it to active notifications).
Data from "IsBadgeWorking?":
The text was updated successfully, but these errors were encountered: