Notification system for messaging


I was wondering if anyone has any system or rule for sending push notifications in a messaging app. Is it a matter of sending “push notifications” for any message or do people have a different approach?

Say my chat is between person A and person B.

If person A is sending a new message, my approach is only sending notifications to person B only if the previous message from person A is more than X minutes ago. X is usually 15 or 30.

I can calculate the difference in timestamps between those 2 messages to support the logic.