How to add notification indicator in your Kodular app using Firebase and Tiny DB?

Hi Koders!!!

Today I am going to show you the way on How to add notification indicator in your Kodular app using Firebase and Tiny DB?

Create a project. (This is an obvious step)

Now do as follows:

Explanation:

a) Set the condition on screen initialization to store the notification count in the Tiny DB, so that Tiny DB will not set the notification count value to 0 every time the screen will initialize.

b) If the screen 2 is initializing is for the first time, Tiny DB will create tag with tag name “first_time” and the value will “no”.

c) Now if the value will be “no”, app will get the notification list from Firebase. If the value will not be “no”, which means the app screen is initializing for the first time, then step (b) will be repeated again.

d) After getting the notification list from the Firebase DB, we will compare the length of the notification list with the count which was stored in the Tiny DB. If the count value in Tiny DB will not be equal to the length of notification list, the label will show that the notification has been received.

e) When user will click on the label, Tiny DB will store the new value for the tag “count” which will be the updated count of notification list and hence, user will not see the notification indicator again.

Hope it will help you.
Thank you.

2 Likes

Nice guide! I think it will help all, especally newbies who don’t understand this topic (Like I did :sweat_smile:)

Keep up the awesome work!

Yoshi :stuck_out_tongue_winking_eye:

2 Likes

Thanks. :slight_smile:

1 Like

Funny Reply

1 Like

I didn’t understand, for what purpose is this guide ?

Its better to post result screenshots or a video.

I think so he is talking About image this.

2 Likes

Actually I am talking about the notification indicator like Facebook. When receive notifications on Facebook, we see the red dot above the bell icon, that’s what I am trying to say.

1 Like

No. I am talking about in app notification like Facebook.

Ohh kk fine. :relaxed:

1 Like

Error shown.
Same blocks created
And get notification tag from firebase

What I want to do

You’ve to store value in the form of list but you are storing the value in the form of string. That’s why you’re getting the error.

1 Like

:thinking:
I still don’t getting your point

I mean, to get the length of list, the value should be the list but your value is in the form of string.

It might be a good idea to learn how to use lists. Read the docs for more info.

1 Like

So What i do now with firebase

I don’t know about coding
Your all of suggestions go above my head…

First store the value in the form of list.
Remember, [1,2,3] is the list form while 1,2,3 is string form.

This post was flagged by the community and is temporarily hidden.

I can talk in hindi but it’s not allowed here.

I think your guide is incomplete for new beginner
Please show me what are you string and how to set that…1,2,3