Add notifiable to expo notification#42
Open
maximetassy wants to merge 7 commits into
Open
Conversation
… sent notification
maximetassy
force-pushed
the
feat/add-notifiable-to-expo-notification
branch
from
May 12, 2025 12:32
d765274 to
e3d7a6f
Compare
…to-expo-notification
maximetassy
force-pushed
the
feat/add-notifiable-to-expo-notification
branch
from
May 12, 2025 12:33
e3d7a6f to
1b1f494
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
receiverto 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_CONTAINSin 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.