Added WebpushNotification.Builder API with additional Webpush parameters#193
Added WebpushNotification.Builder API with additional Webpush parameters#193hiranya911 merged 8 commits intomasterfrom
Conversation
| /** | ||
| * Sets any arbitrary data that should be associated with the notification. | ||
| * | ||
| * @param data A json-serializable object. |
|
|
||
| @Key("notification") | ||
| private final WebpushNotification notification; | ||
| private final Map<String, Object> notification; |
There was a problem hiding this comment.
Sorry, I don't quite follow where this private fields are ever read. Can you elaborate?
I am asking this because I liked using WebpushNotification here better but I can see reason why the Map would be more appropriate.
There was a problem hiding this comment.
All these get serialized into JSON. We now need a Map because the notification now allows arbitrary key-value pairs (via putCustomData()).
hiranya911
left a comment
There was a problem hiding this comment.
@schmidt-sebastian made the suggested change.
|
|
||
| @Key("notification") | ||
| private final WebpushNotification notification; | ||
| private final Map<String, Object> notification; |
There was a problem hiding this comment.
All these get serialized into JSON. We now need a Map because the notification now allows arbitrary key-value pairs (via putCustomData()).
| /** | ||
| * Sets any arbitrary data that should be associated with the notification. | ||
| * | ||
| * @param data A json-serializable object. |
schmidt-sebastian
left a comment
There was a problem hiding this comment.
Thanks for enlightening me!
FCM Webpush API now supports additional parameters as defined in https://developer.mozilla.org/en-US/docs/Web/API/notification/Notification
Related to firebase/firebase-admin-node#305