Notifications/Developer guide/Push

Push notification support was added to the Echo extension in version 1.36.0. The implementation is documented here.

Overview
Push notification support is implemented as a third  notifier type alongside the previously existing   and   types. The  notifier, implemented in the   class, handles notifications by enqueuing an   job to query the DB for any registered push subscriptions associated with the recipient's global user ID. Push notification requests are sent to an external service (see mediawiki/services/push-notifications) for each subscription found. As currently implemented, the notification requests contain only a generic message intended to prompt the recipient app to "phone home" to the MediaWiki API's notifications module to retrieve full message content.

It is the client's responsibility to register users' push subscriptions via the echopushsubscriptions API module and update their notification preferences in order to benefit from push notifications.

As of September 2020, only app push notifications are supported, via Firebase Cloud Messaging (FCM) for Android and Apple Push Notification Service (APNS) for iOS. In the future (prospectively Q2 FY2020-2021) Echo will be updated to handle web push.

Quirks and gotchas
The  and   notifier types are defined and configured entirely in Echo's extension.json. In constrast, the push notifier type currently must be configured locally in  or in   and   at Wikimedia. This is to support conditionally enabling push by wiki. As of September 2020, in Wikimedia production, Echo push is only enabled on the Wikipedias. If and when Echo push is rolled out to all Wikis, this configuration can be moved to extension.json.