1

I am new to this so if it's a silly one please consider.

I have a scenario where I am creating articles from admin and showing them to end users in front-end as website notification.

The problem here I am facing is I am not able to restrict notification to each user. My requirement is, any user visits the website should get that notification only once.

Please Suggest something. Thanks in Advance.

Arpit
  • 47
  • 1
  • 7
  • Define "user". Are you talking about anybody who visits the website? Or identified, logged in users? – Quentin Oct 25 '17 at 10:27
  • use localStorage or cookies.. – Steve Oct 25 '17 at 10:37
  • 1
    You should also try https://webengage.com/. but its 3rd party service. – TarangP Oct 25 '17 at 10:43
  • If you don't mind using a third party service, you can use Pushpad: it has a [PHP library](https://github.com/pushpad/pushpad-php) and you can easily target specific users as described in this [blog post](http://blog.pushpad.xyz/2017/06/how-to-send-single-user-targeted-notification-with-web-push-api/). – collimarco Oct 25 '17 at 13:00

1 Answers1

0

It can be done with help of database,

You can have one flag in user's table in database which would store status of the notification (whether it was shown to the user or not). And when the user logs in, based on the value, you can decide whether the notificaiton should pop in or not.

Himanshu Upadhyay
  • 6,558
  • 1
  • 20
  • 33