Notifications and activity

Kate Santo Updated by Kate Santo

There is a lot a user can do in a Padoq app: create posts, comment on posts, handle payments, react to another user's post, choose events to attend, report issues, privately chat to other members of their padoqs, etc. There are 2 parts of the app that are particularly useful to keep track of what's going on: Notifications and Activity.

In this guide, we'll look at the technical aspects of each of those features.

You can check out the user version of this guide in Your notifications and activity.

Prerequisites

  • You can download the iOS or Android app on your phone to see what the user sees. And you can also log in or sing up to the web app here
  • If you are already logged into the web app, head straight to the notifications page here and the activity page here
  • You can also see the UI by checking out the images you'll find in the guide
  • You will find the relevant endpoints linked and explained in this guide, but the full API is documented in Swagger UI

Notifications

The vast majority of what appears in the notifications page is retrieved via the getNotifications and getNotificationCount endpoints. The latter is a count of new notifications since the last time the user requested them. The getNotifications endpoint takes 2 optional parameters (from and to) that allow the app to only fetch notifications for a specific period of time.

The response is made up of just one notifications property, which has the Activity schema as its value.

Here's an example of how an item in the Activity schema might look like:

{
"notifications": [
{
"type": "MEMBERSHIP_REQUEST",
"id": "0857ef05-c780-4fe2-a4d3-518732495f19",
"at": "2021-03-04T09:43:14.640Z",
"isNew": true,
"messageKey": "notification.membershipRq",
"messageParameters": {
"memberName": null,
"padoqName": "my-place",
"padoqId": "0857ef05-c780-4fe2-a4d3-518732495f19",
"postId": "a97de803-66f6-485e-aa79-fdd3bb678d94",
"postUri": "string",
"postType": "BASIC",
"title": "A Title" }
}
]
}

These are the properties in the Activity schema:

  • type: the value of this property is an array containing the 24 types of activity that can go into the notifications area in the UI. There are types such as MEMBERSHIP_ACCEPTED, MADE_ADMIN, MENTION or EVENT_CANCELLED. They all notify the user of different things happening in the app that they need to know about
  • id: this is an optional property that contains the ID of a post. It's relevant for notifications linked to a post, like POST_REPORTED or POST_REMOVED
  • at: this is the date and time when the activity happened. This is a very important and compulsory property for things like counting notifications (see next property)
  • isNew: in the UI, there is a notifications icon that displays a dot when there are unread notifications. As long as they are not viewed, the value for isNew will be true. When the user views a notification, isNew will change to false and the notification won't be highlighted as new anymore
  • messageKey: each notification comes with a message that is displayed in the UI. This property stores the keys for the app to find the right message for each notification. It's used together with the next property
  • messageParameters: each message mentioned above has placeholders that are necessary for the app to complete the text. For example an ADMIN_POST notification might say: Juliet Smith has made an admin post in Building A. For the app to display that message, it needs parameters like: memberName (Juliet Smith), padoqId and padoqName (Building A) and postId (so the user is taken to the original post when they tap the notification). The parameters needed for each type of notification message are stored in this property

Activity

On mobile and web clients, there is an option called Activity within the My Profile/Account area. When the user taps on Activity, the getActivities endpoint is called. This endpoint takes only 1 optional parameter (from), which sets how old we want the oldest activity returned to be.

The response from that endpoint is exactly the same as the response for the getNotifications endpoint (see above for a detailed explanation).

How did we do?

What are Padoq categories?

Super Admin Dashboard - Issue reports

Contact