carsonwah / react-native-push-notification-popup

A <NotificationPopup/> component for presenting your own push notification in react-native app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Display multiple popups?

Strate opened this issue · comments

Hey!
Just found this awesome library, thank you for this!

Is there any way to display more than 1 notification popup?

Thank you @Strate !

What do you mean by displaying more than 1 popup?

Currently if you .show() while there is still a popup displaying, the current one will be discarded immediately.

Do you want multiple popups to be stacked onto a single one, or just one-by-one filling up the screen?

@carsonwah I want to display, for example, maximum 3 notifications, and next notification should hide oldest one.

So, you dispatch 3 notifications. It goes like:

show 1st -> few seconds -> hide 1st, show 2nd -> few seconds -> hide 2nd, show 3rd -> ...

Something like this?

show 1st - visible list: [1st]
show 2nd -> visible list: [2nd, 1st]
show 3rd -> visible list: [3rd, 2nd, 1st]
show 4th -> visible list: [4th, 3rd, 2nd] (1st hidden on that case)

And all of them hides after some duration

I see. Interesting. This is not a standard push notification approach on native platforms.

The hardest part of this i guess would be handling the gestures from user.

I will take it into consideration. Meanwhile, if you can help on this, you may open a pull request. Thanks a lot.

@carsonwah is there any way of implementing this while disabling the gesture?

@ManigandanRaamanathan Should be possible. Better to write a new component for this and let user choose. (though I think disabling the gesture will be a bit weird)

Any PR is welcome.