pocheshire / BottomNavigationBar

Bottom Navigation Bar for Xamarin
214 stars 70 forks source link

How to update badge count while app is open? #81

Open Srusti-Thakkar opened 6 years ago

Srusti-Thakkar commented 6 years ago

Hi. I am using your plugin and it works fine. My problem is I want to update badge count When notification is received while app is in running mode(i. e. open). I am using Setting Plugin for Xamarin and store count in that. On app initialize it display counts properly. But when my app is open I am changing value of Setting and immediately change the value pf badge. How's that can be possible?

Main thing is I want to increment and decrements badge count on button click event. How's that possible?

gioggio79 commented 6 years ago

Try this: On App.cs set the TabbedPage -> public static CustomTabbedPage TabbedPage;

and you can use this for update: CustomTabbedPageExtension.SetBadgeCount(App.TabbedPage.Children[3], badgeNum);