Page MenuHomePhabricator

Create demo Android client for Push Notifications
Closed, ResolvedPublic

Description

Background information

During the development of the new push-notifications infrastructure, the PI engineers would like to have a simple demo client to test the infrastructure before the integration with the main Wikipedia app begins.

What

  • A demo Android app with very simple functionality that can subscribe to the push service and receive push-notifications.

How

...

Open questions

  • How to display the received content, e. g. raw vs pretty format or both?

Acceptance criteria

  • The app is able to subscribe to the push-service (we're actually doing it manually)
  • The app can receive push-notifications
  • The app is able to display the received content as descriptive as possible

Event Timeline

MSantos created this task.May 13 2020, 4:33 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 13 2020, 4:33 PM

@MSantos is the service in a state that it's ready to have a test client built against it? No problem if not, but please ping @Charlotte here when it's ready to go

MSantos added a comment.EditedMay 18 2020, 3:59 PM

@JoeWalsh I put some thinking around this challenge of not having the service ready. And I came up with the following idea.

  • The app client has a form with input fields to specify an endpoint, the payload, and a submit button to trigger a push notification. Defining these inputs gives us flexibility to use the same code base in different phases:
  1. Trigger FCM API directly from the client
  2. Tweak the endpoint input to hit the new service when the time comes to simulate the interaction between ECHO and the push service
  3. Ignore the input field and test Echo -> service push notification flow but still being able to debug the received push notification message/data
  • The app has another form to hit the API to create a subscription, in order to test Echo subscription flow, showing the raw response data for debugging purposes

Open questions:

  • Could the device tokens be available for copy-paste and we manually define the payload to submit to the push-notification trigger API? Is it worth the effort?

Other notes:

  • The app client doesn't need to show the received push notification in any format other than raw IMO, this should be enough for debugging.

What do you think? cc/ @Mholloway, @bearND, and @Jgiannelos

What we definitely need from an Android client is:
(1) subscribing to FCM then making the subscription data available for copy pasting and
(2) a way to display the received notifications, raw format is fine
For the above the client does not need to know much about the push notification service besides that it does FCM.

I think the triggering of a push notification from the Android client is nice to have but not needed initially.

@JoeWalsh @MSantos @bearND - We saw that @Mholloway has put in a pull request for something that talks to a push notifications framework... so we're curious what exactly you need from the Android team? (cc @Dbrant)

This feels like it's worth a half-hour meeting (including engineering management from PI and apps and both app PMs) to get people on the same page — sound good?

I believe the idea behind this task and its iOS equivalent was to have minimal, focused clients that both PI and the app teams could use for testing this API. I wouldn't expect that it would be something that would take an experienced app engineer long to build, and I'd expect that the code could be ported directly into the full Wikipedia apps in the end.

I did submit a PR (https://github.com/wikimedia/apps-android-wikipedia/pull/954) a while back with updates I made to the Android app while prototyping an early service candidate in order to have something to send messages to. That said, my Android dev skills aren't razor-sharp these days, and the code is fairly brittle. The team can use it if it's useful, or ignore it if not.

Or, there's the checkin meeting next Monday; perhaps we could all discuss then.

Yes, I'll add @Dbrant to the checkin on Tuesday (since we moved it b/c of the holiday) and we can get everyone on the same page.

What we definitely need from an Android client is:
(1) subscribing to FCM then making the subscription data available for copy pasting and
(2) a way to display the received notifications, raw format is fine
For the above the client does not need to know much about the push notification service besides that it does FCM.

I think the triggering of a push notification from the Android client is nice to have but not needed initially.

So, we need something very simple for debugging only, after some discussion in the team meetings, I gave it a try and coded a simple Android App. @bearND can you take a look and confirm that the approach is enough for our initial needs?

Hi @MSantos. This looks pretty good to me. The main thing I would add are some instructions for the google-service.json file to the readme file. I've added some ideas for a simpler UX as Github issues.

MSantos closed this task as Resolved.Jun 25 2020, 3:02 PM
MSantos updated the task description. (Show Details)