rhanb/nativescript-bottombar

[iOS] Badges do not show if initially set to blank

vtjon opened this issue · 8 comments

vtjon commented

It appears that on iOS that the badge number does not show unless you initialize the item with a non-empty string. In looking at the iOS code, it appears that it only adds the badgeLabel to the view when it's not an empty string.

Any news on when this might be fixed? As far as I can tell, the issue is actually in MiniTabBar rather than this plugin. Workaround is to initialise each item with non-empty string and then set them all back to empty strings in the bottombar loaded handler before they appear.

rhanb commented

Please provide code to reproduce the issue, thanks 👍

#75 is related to this issue. if the badges is not initially at the first place(like the following example). when updating the notification will not display the badges on ios.

public bottomBarItems: Array = [
new BottomBarItem(0, "Chat", "ic_home_black_24dp", "whitesmoke", new Notification("white", "red", "")),
];

the badges will update if i declare the bottomBarItem like the following:

public bottomBarItems: Array = [
new BottomBarItem(0, "Chat", "ic_home_black_24dp", "whitesmoke", new Notification("white", "red", "0")),
];

rhanb commented

Should be fixed with the pre-release 4.0.0-rc1.1. Be careful, there is a lot of breaking changes.

package.json on the NativeScript still showing that the latest version is 3.0.8. how can I apply the changes ?

rhanb commented

the latest release doesn't fix this issue. its still need to set the initially badge to 0 in order to display the badge when increase to 1. (its not working in android)

rhanb commented

Could you provide a repo or something to reproduce the issue ? Wich version are you using ?

It should be fixed