Page MenuHomePhabricator

infrastructure for Android app development for Wikimedia wiki (not only commons and wikipedia)
Closed, InvalidPublicFeature

Description

Feature summary (what you would like to be able to do and where):

  • create apps for Wikimedia wikis myself including ability to do push notifications triggered by certain events on-wiki

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

  • apps for any sister wikis not only Wikipedia

Benefits (why should this be implemented?):

Ideally step by step instructions on hosting of the required infrastructure can be provided. Volunteers can create vps with Wikimedia hosting service and ensure that the infrastructure is working normally for the small wiki.

I believe this is rather urgent as the smaller wikis are frequently smaller and require increased user engagement.

Related Objects

Event Timeline

Dbrant removed a project: Android Design.
Dbrant subscribed.

There have been requests in the distant past for a "generic MediaWiki app" (T165495), but over the course of time, the official Wikipedia app has become rather dependent on Wikipedia-specific services, not just MediaWiki and its extensions.

Generally speaking, you could build an app that exclusively uses the Action API for basic things like logging in, editing and reading content, and so on.
(The Wikipedia app, instead of using the Action API, uses a special REST service for rendering article contents, which in turn uses Parsoid, but this is not strictly necessary for a hypothetical generic app.)

But for the specific feature of push notifications, you will definitely need additional bits of infrastructure:

  • You would need to self-host the push-notifications service, which receives notifications from the Echo extension, and configure Echo to communicate with your service.
  • The above service then needs to be configured to communicate with Firebase (for Android notifications) and/or APNS (for Apple notifications), i.e. put your Firebase API key on the server.
  • Your app then needs to integrate with the client-side Firebase libraries, which will provide your app with a subscription token, and then finally use the echopushsubscriptions API to send the subscription token to Echo.

Thank you for this information!

For push-notifications service. Where is this typically hosted? On a vps like this https://wikitech.wikimedia.org/wiki/Help:Cloud_VPS ?

To clarify, are you referring to building apps for your own personal wiki, or for other Wikimedia wikis?

If it's for other Wikimedia wikis that are already sharing user accounts with Wikipedia (e.g. Wikivoyage, Wiktionary, etc), then no other infrastructure should be required. Your app can just use the echopushsubscriptions API to subscribe the user's Firebase device token to start receiving Echo notifications.

This is for a Wikimedia wiki.

So pushnotifications is already installed somewhere (step 1 and 2 from bullet list above).

What is a "user's Firebase device token"? Do I as an app developer need to know it?

So pushnotifications is already installed somewhere (step 1 and 2 from bullet list above).

A slight correction: When your app is completed and ready to receive notifications, we would need to add your app's Package Name to our Firebase account, with the approval of our teams. (Sorry there's no standard procedure for doing this, since there haven't been any other apps that have needed to receive push notifications; The push-notifications service was built with the Wikipedia app specifically in mind.)

What is a "user's Firebase device token"? Do I as an app developer need to know it?

Yes. You can refer to tutorials on using Firebase in your app, or refer to how it's used in the Wikipedia app.

With all that being said, there is a simpler (but less efficient) way for you to show notifications without using Firebase entirely, which is just to periodically explicitly check for new notifications in the background using the API, i.e. create a background service that queries the API once every hour, for example. And based on the API response, your app can show a system notification to the user. This is basically how the Wikipedia app worked before push notifications were built.

Here is an example API call that gives you a list of your most recent unread notifications, from all wikis (not just Wikipedia!):
https://en.wikipedia.org/w/api.php?formatversion=2&action=query&meta=notifications&notwikis=*&notprop=list&notfilter=!read&notlimit=1

Closing as this is not in scope / not-actionable for the Wikipedia-Android-App development, and as this sounds like a support request which should not have been filed as a ticket in Phabricator.