How to Add Notification COUNTS/DOT inside app

Hey i have made and app and it has a notification screen, which is opened on click of a BUTTON,

I want to add the following feature in it -

Whenever there is a new notfication, that BUTTON shows, some kind of animation/count something like that, indicating there is new notification

AND WHEN THAT USER HAS CLICKED THAT BUTTON AND AGAIN OPENS THE APP (or that screen) THE COUNT/ANIMATION SHOULD BE GONE

has anybody done it ? if so, help me please

Yes.
I’ve used lottie animation , tiny db and firebase db for that…
I’ll make a sample block for you, soon

1 Like

tysm, it would be helpful if you provide aia for the same:blush:

Yes, I have done it before.

How to do it :
If it’s a button make 2 images. One with a dot and one a Normal one. Use tinydb and Change Data when there is a notification. For example, The value of the tag notification can be set to true or false and in the blocks… If it’s true change the image to the notification one else set it to the Normal one

1 Like

Okay…
Perhaps i would make a new topic on guides category and provide link here…
And also the aia :wink:
Perhaps within a week [bit busy now​:confused:]

3 Likes

okay till then @Abhijith_Dominic if you have some time, can you show me blocks ?

Not right now… Maybe after a few hours

1 Like

okay sure, i shall ping uh in evening

1 Like

Thats great idea,:sunglasses::sunglasses::sunglasses:

1 Like

hey i have done this so far… with FIREBASE, TINY DB

now what if i have to send a notification after 1 hour (let it be any time after this event), the value is stored in tiny db that the user has seen the notification, and it will always show Notification has been read :thinking:

so when should be the event of clearing tiny db tags should be raised, i hope you get what am saying

hey @Abhijith_Dominic are you free now ? have a look at the blocks plz

Simply store the current time in tinyDB or Firebase. When the app opens again by the user then calculate the time gap between now and the stored value.

if(difference >= reqired_time_gap){
//perform any task
}

no, you did not get what i wanted to say,

take exapmple of facebook, when you open the app, it has notifications, you clicked them and the notification count goes away, and when again a notification comes the notification badge again comes in the app,

i want this !

When the application opens check for the notification massage.

GetNotificationFromFirebase();

When got the value.

Check for the last notification stored in the tiny DB.

if(last massage == firebase_massage)
{
//no need to perform any task
}else{
//show a toast massage
//store the new massage to the tinyDB
// and what ever task you want
}

Hope it hepled you.

1 Like

thanks i will try this

1 Like

I’ve done exactly like this…
But with Lottie file…
You used material icons…

but my concern is this… let me explain you how I send notifications to my app

I use One Signal to make users aware that there is a notification in the app.

Here i used firebase, if firebase tag value = yes then it will show NOTIFICATION ICON otherwise it will show CHECK ICON and TinyDB will store value that user has seen message right ?
There is no no problem till now !

Actual problem is, Now the firebase value is set to YES and user has seen message, now if I again send a notification using one signal it should again show NOTIFICATION ICON which will not happen coz tiny db has stored SEEN tag !

what should be done so that when i send notification using ONE SIGNAL, the tiny db tag gets cleared and it again shows NOTIFICATION ICON

for that the blocks which are discussed on this topic should work…

Try those blocks… If they worked on your application your problem solved… :metal:

1 Like

okay i wil take a look and tell uh :blush: