I don’t know this topic and can’t help you much but the way I’d approach it is to check for example code implementing NotificationFilter and see how they do it.
/**
* Filtering expression to use when retrieving notifications.
*
* @param user the user interested in the notifications
* @param filterPreferences the collection of all preferences to take into account
* @param preference the notification preference associated with the filter
* @return the updated query
*
* @since 9.7RC1
*/
ExpressionNode filterExpression(DocumentReference user, Collection<NotificationFilterPreference> filterPreferences,
NotificationPreference preference);
It says the updated query but it doesn’t explain where is the query? I don’t see any query being passed!
I understand that filterEventExpression is just condition rewritten as an expression, for example
in existing SystemUserNotificationFilter (for filtering system events) the filterEvent is