The FCM notification request endpoint in the push notification service only accepts a single message definition per HTTP request. For efficiency's sake, it would be useful to allow defining messages for multiple providers in a single HTTP request, so that the client (i.e., MediaWiki) could handle all subscriptions found for a user in a single HTTP request. I imagine this will be particularly handy in Phase 2, when we implement support for Web Push.
This type of request could be accepted via POST at /v1/message and take a message body like:
{ "apns": { "deviceToken": "foo", "messageType": "checkEchoV1" }, "fcm": { "deviceToken": "bar", "messageType": "checkEchoV1" } }
Handling this in the service would simply be a matter of handling the values for each provider key in the provider-specific library code. I would imagine that multiple messages could also be defined per provider as described in T254359.
Acceptance Criteria
- /v1/message endpoint allows multiple providers POST parameter
- Echo client is adjusted to send the new schema properly
- Deprecate /v1/message/apns and /v1/message/fcm ?