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

badge count in tabbar ? #28

Closed
kaiyes opened this issue Sep 8, 2017 · 10 comments
Closed

badge count in tabbar ? #28

kaiyes opened this issue Sep 8, 2017 · 10 comments

Comments

@kaiyes
Copy link
Contributor

kaiyes commented Sep 8, 2017

Hi, Can you do this please ? Notification count in the react navigation tab bar icons. Obviously this will be a subscription. Hooking it with the react navigation tab bar icons is the key.

badge

Or pointing me to the right direction will be huge help as well. Thanks as always

@EQuimper
Copy link
Owner

EQuimper commented Sep 8, 2017

yes gonna make a video about it, thank for the idea didn't think of it

@kaiyes
Copy link
Contributor Author

kaiyes commented Sep 10, 2017

I think using redux will be simpler.

Found this. react-navigation/react-navigation#1941

@baldurpan
Copy link

I managed to add a badge via tabBarIcon in navigationOptions. Works quite well in iOS but in Android it has some transparency (like opacity 0.7) unless the tab is focused.
Very annoying.

@kaiyes
Copy link
Contributor Author

kaiyes commented Sep 26, 2017

@baldurpan me too. I was able to add a badge as well. But I wasn't able to add subscription to that badge icon.

@EQuimper
Copy link
Owner

I think if you need to put that in subscriptions you gonna need to have it as his own component or wrote your own tabbar component. With React-Navigation thats pretty easy. I check this thing tonight maybe I can find something

@kaiyes
Copy link
Contributor Author

kaiyes commented Sep 27, 2017

This is what I have right now. But its static.

screenshot 2017-09-27 12 55 21

@EQuimper
Copy link
Owner

Did you connect the tab for ? I mean this thing can be extends as a component I did on one of my app, and I think you can plug a subscriptions on this on

@kaiyes
Copy link
Contributor Author

kaiyes commented Sep 30, 2017

Okay. I was able to implement a custom component in react-navigation's tabBar component. Also, I was able to add redux to change the number of the notification icon. But I have two problems :

  1. Subscription doesn't start if I don't go over to the tab first. In other words, subscription needs to be called from the component first. Otherwise it doesn't work.

  2. I need a way to change the badge icon number to 0/null once the icon has been clicked. (emulating a seen effect)

@kaiyes
Copy link
Contributor Author

kaiyes commented Oct 1, 2017

tried another method. Made a notifications collection and fed notification query and subscription to icon component. However, the icon component doesn't take the subscription. Same subscription works in a normal page. However, after going to a page where the component is , the same component in the navbar starts working. @EQuimper what do you think ?

@kaiyes
Copy link
Contributor Author

kaiyes commented Oct 2, 2017

Finally was able to make the badge count reactive from the get-go. Answer lies in #39

@kaiyes kaiyes closed this as completed Oct 2, 2017
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

No branches or pull requests

3 participants