Create activity feed
Learn how to build an in-app activity feed using OneSignal’s REST API, Event Streams, or on-device logic to track and display user notification history.
What is an activity feed?
An activity feed lets users see the history of notifications they’ve received within your app.
OneSignal focuses on delivering notifications but does not currently store the history of messages sent to each individual user. To build this functionality, you’ll need to store notification data yourself—either on your backend server or directly on the user’s device.
Saving to server
Recommended Approach
Rather than relying on background processing in your app, use the Create notification REST API to send each notification and also store a copy on your server. Then, when the app launches, it can check the server for updates.
Once the data is stored, you can retrieve and display the user’s notification history at any time.
Saving to server
Recommended Approach
Rather than relying on background processing in your app, use the Create notification REST API to send each notification and also store a copy on your server. Then, when the app launches, it can check the server for updates.
Once the data is stored, you can retrieve and display the user’s notification history at any time.
Create an activity feed using OneSignal Event Streams
OneSignal’s Event Streams feature provides a scalable way to stream real-time events from your app to your backend systems or data warehouse. This lets you build a feed that reflects in-app user behavior—like follows, comments, purchases, or notification events—without manually updating the feed within your app.
How it works
Event Streams exports live event data including:
- Notification deliveries
- Email/SMS opens and clicks
- User-triggered actions
Destinations include:
- Webhooks (your HTTP endpoints)
- Amazon Kinesis
- Amazon S3
- Google Cloud Storage
- BigQuery
- And more
Your system receives these events as they occur and can use them to update a feed UI or analytics pipeline.
Steps to set up an Activity Feed with Event Streams
Enable Event Streams
- Go to the OneSignal Dashboard > Settings > Event Streams.
- Choose a destination such as a Webhook or data pipeline (e.g., Amazon Kinesis).
- Select the events you want to stream (e.g.,
message.sent
,message.delivered
,message.clicked
).
Configure your backend to handle event data
-
Create a webhook or consumer that ingests event data.
-
Parse the event payload to extract relevant fields like:
external_id
(the user ID)event
type (message.delivered
, etc.)timestamp
contents
(notification message)additional_data
(any custom metadata)
Store and structure Activity Feed entries
- Save these events to your database in a format suitable for querying and rendering.
Render the feed in your app
- Build a frontend component (e.g., React, SwiftUI, or Android View) to query and display recent events for the logged-in user.
- Optionally include filters or grouping by event type.
Enhance with additional metadata
-
When sending notifications, include
additional_data
to provide feed context, for example: -
This allows you to create rich feed entries such as “Jane commented on your post.”
Example use cases
- E-commerce: Show order confirmations, shipping updates, and promotions.
- Social Apps: Show likes, comments, follows.
- SaaS Platforms: Track task assignments, mentions, or activity logs.
Benefits
- Real-time updates via event streaming
- Fully customizable logic and display
- Scalable, backend-driven architecture