laravel-expo-notifier icon indicating copy to clipboard operation
laravel-expo-notifier copied to clipboard

Add notifiable to expo notification

Open maximetassy opened this issue 7 months ago • 0 comments

This PR follow this one : #41


Link expo notification to it's receiver

Problem

To avoid sending multiple time the same notification for a user, we need to add an id in the data that is sent to expo and check with something like this JSON_CONTAINS(JSON_UNQUOTE(JSON_EXTRACT(expo_notifications.data, \'$.data\')),\'"' . $user->id. '"\',\'$.user_id\') It is not really easy and have some performance losses.

Solution

Add a nullableMorph receiver to the expo_notifications table.

close #24


By the way, it would be nice to not set all classes as final to allow some flexibility for storing notification or anything else. I still need to use some JSON_CONTAINS in sql in order to keep trace of the type of notification i've send. So extending the notification store class would allow adding a type attribute in my notification table or any other custom attributes. it seems even more relevant when you see that you can pass any class in the package config.

maximetassy avatar May 10 '25 15:05 maximetassy