# Overview

Stream Activity Feeds supports push notifications through Firebase Cloud Messaging (FCM) and Apple Push Notification (APN) providers.

Push notifications help keep users engaged by delivering real-time updates about activities, reactions, comments, and other feed events when the application is closed or in the background.

<admonition type="info">

The Stream API doesn't support web push notifications. However, if you're building a mobile application using JavaScript technologies, you can set up mobile push notifications using the supported providers: Firebase Cloud Messaging (FCM) and Apple Push Notification (APN).

</admonition>

## When Push Notifications Are Sent

Activity Feeds sends push notifications in the following scenarios:

- **New Follower** when a user follows another user
- **Comments** added to activities the user is involved with
- **Reactions** added to the user's activities
- **Comment Reactions** added to the user's comments
- **Mentions** when a user is mentioned in activities or comments
- **Notification feeds** - activities added to the default notification feed automatically trigger push notifications

## Push Delivery Rules

Push notification delivery follows these rules for Activity Feeds:

- Only users with registered devices receive push notifications
- Push notifications are sent to all registered devices for a user (up to 25 devices)
- Users must have proper permissions granted for notifications
- Push notifications are sent for activity updates like new comments and reactions
- Notifications respect the feed's privacy settings and user permissions
- Activities added to the default notification feed automatically trigger push notifications
- You can skip push notifications for individual actions using the `skip_push` parameter on comments, reactions, and follows

## Feed Groups and Push Notifications

Push notifications in Activity Feeds are configured at the feed group level. Each feed group can have its own push notification settings:

- **Built-in feed groups** like `notification` and `user` come with default push configurations
- **Custom feed groups** can be created with specific push notification settings
- **Activity types** can be selectively enabled for push notifications using `push_types`

For detailed configuration options, refer to the Feed Group Push Configuration documentation.

## Configuring Push Providers

You need to configure your push providers through the Stream Dashboard:

1. Navigate to your [Stream Dashboard](https://dashboard.getstream.io/)
2. Select your application
3. Go to the **Push Notifications** section
4. Click **New Configuration** and select your provider
5. Upload your credentials (Firebase service account JSON, APN certificates, etc.)

For detailed configuration instructions, refer to the Push Providers & Multi Bundle documentation.

## Getting Started

To set up push notifications for Activity Feeds, you need to:

1. **Configure your push notification provider** on the [Stream Dashboard](https://dashboard.getstream.io/)
2. **Add client-side integration** for your chosen provider in your app
3. **Register user devices** with Stream's API

## Implementation Examples

### Direct Push Notifications

Direct push notifications are sent immediately when events occur. Use `skip_push: false` (default) to enable direct push:

<Tabs>

```js label="JavaScript"
// Comment with direct push notification (default behavior)
await client.addComment({
  object_id: activity.id,
  object_type: "activity",
  comment: "Great post!",
  // skip_push: false (default) - sends push immediately
});

// Reaction with direct push notification
await client.addReaction({
  activity_id: activity.id,
  type: "like",
  // skip_push: false (default) - sends push immediately
});
```

```js label="React"
// Comment with direct push notification (default behavior)
await client.addComment({
  object_id: activity.id,
  object_type: "activity",
  comment: "Great post!",
  // skip_push: false (default) - sends push immediately
});

// Reaction with direct push notification
await client.addReaction({
  activity_id: activity.id,
  type: "like",
  // skip_push: false (default) - sends push immediately
});
```

```js label="React Native"
// Comment with direct push notification (default behavior)
await client.addComment({
  object_id: activity.id,
  object_type: "activity",
  comment: "Great post!",
  // skip_push: false (default) - sends push immediately
});

// Reaction with direct push notification
await client.addReaction({
  activity_id: activity.id,
  type: "like",
  // skip_push: false (default) - sends push immediately
});
```

```js label="Node"
// Comment with direct push notification (default behavior)
await serverClient.feeds.addComment({
  object_id: activity.id,
  object_type: "activity",
  comment: "Great post!",
  user_id: "user-456",
  // skip_push: false (default) - sends push immediately
});

// Reaction with direct push notification
await serverClient.feeds.addReaction({
  activity_id: activity.id,
  type: "like",
  user_id: "user-456",
  // skip_push: false (default) - sends push immediately
});
```

```go label="Go"
// Comment with direct push notification (default behavior)
_, err = client.Feeds().AddComment(ctx, &getstream.AddCommentRequest{
  ObjectID: activityID,
  ObjectType: "activity",
  Comment: "Great post!",
  UserID: getstream.PtrTo("user-456"),
  // SkipPush: getstream.PtrTo(false), (default) - sends push immediately
})
if err != nil {
  log.Fatal("Error adding comment:", err)
}

// Reaction with direct push notification
_, err = client.Feeds().AddReaction(ctx, activityID, &getstream.AddReactionRequest{
  Type: "like",
  UserID: getstream.PtrTo("user-456"),
  // SkipPush: getstream.PtrTo(false), (default) - sends push immediately
})
if err != nil {
  log.Fatal("Error adding reaction:", err)
}
```

```php label="php"
use GetStream\GeneratedModels;

// Comment with direct push notification (default behavior)
$feedsClient->addComment(new GeneratedModels\AddCommentRequest(
    objectID: $activity->id,
    objectType: "activity",
    comment: "Great post!",
    userID: "user-456",
    // skipPush: false (default) - sends push immediately
));

// Reaction with direct push notification
$feedsClient->addActivityReaction($activity->id, new GeneratedModels\AddReactionRequest(
    type: "like",
    userID: "user-456",
    // skipPush: false (default) - sends push immediately
));
```

</Tabs>

### Notification Feed Push Notifications

Use `create_notification_activity: true` with `skip_push: true` to send push via the built-in `notification feeds`:

<Tabs>

```js label="JavaScript"
// Comment that creates notification activity and sends via notification feed
await client.addComment({
  object_id: activity.id,
  object_type: "activity",
  comment: "Great post!",
  create_notification_activity: true,
  skip_push: true, // Send via notification feed instead of direct push
});
// Reaction that creates notification activity
await client.addReaction({
  activity_id: activity.id,
  type: "like",
  create_notification_activity: true,
  skip_push: true, // Send via notification feed
});
```

```js label="React"
// Comment that creates notification activity and sends via notification feed
await client.addComment({
  object_id: activity.id,
  object_type: "activity",
  comment: "Great post!",
  create_notification_activity: true,
  skip_push: true, // Send via notification feed instead of direct push
});
// Reaction that creates notification activity
await client.addReaction({
  activity_id: activity.id,
  type: "like",
  create_notification_activity: true,
  skip_push: true, // Send via notification feed
});
```

```js label="React Native"
// Comment that creates notification activity and sends via notification feed
await client.addComment({
  object_id: activity.id,
  object_type: "activity",
  comment: "Great post!",
  create_notification_activity: true,
  skip_push: true, // Send via notification feed instead of direct push
});
// Reaction that creates notification activity
await client.addReaction({
  activity_id: activity.id,
  type: "like",
  create_notification_activity: true,
  skip_push: true, // Send via notification feed
});
```

```js label="Node"
// Comment that creates notification activity and sends via notification feed
await serverClient.feeds.addComment({
  object_id: activity.id,
  object_type: 'activity',
  comment: 'Great post!',
  user_id: "user-456",
  create_notification_activity: true,
  skip_push: true // Send via notification feed instead of direct push
});

// Reaction that creates notification activity
await serverClient.feeds.addActivityReaction({
  activity_id: activity.id,
  type: 'like',
  user_id: 'user-456'
  create_notification_activity: true,
  skip_push: true, // Send via notification feed
});
```

```go label="Go"
_, err = client.Feeds().AddComment(ctx, &getstream.AddCommentRequest{
  ObjectID: activityID,
  ObjectType: "activity",
  Comment: "Great post!",
  UserID: getstream.PtrTo("user-456"),
  CreateNotificationActivity: getstream.PtrTo(true),
  SkipPush: getstream.PtrTo(true),
})
if err != nil {
  log.Fatal("Error adding comment:", err)
}

_, err = client.Feeds().AddReaction(ctx, activityID, &getstream.AddReactionRequest{
  Type: "like",
  UserID: getstream.PtrTo("user-456"),
  CreateNotificationActivity: getstream.PtrTo(true),
  SkipPush: getstream.PtrTo(true),
})
if err != nil {
  log.Fatal("Error adding reaction:", err)
}
```

```php label="php"
use GetStream\GeneratedModels;

// Comment that creates notification activity and sends via notification feed
$feedsClient->addComment(new GeneratedModels\AddCommentRequest(
    objectID: $activity->id,
    objectType: "activity",
    comment: "Great post!",
    userID: "user-456",
    createNotificationActivity: true,
    skipPush: true // Send via notification feed instead of direct push
));

// Reaction that creates notification activity
$feedsClient->addActivityReaction($activity->id, new GeneratedModels\AddReactionRequest(
    type: "like",
    userID: "user-456",
    createNotificationActivity: true,
    skipPush: true // Send via notification feed
));
```

</Tabs>

### Custom Notification Feeds

Manually add activities to custom notification feeds for complete control (only for server-side SDKs):

<Tabs>

```js label="Node"
// Add a custom notification directly to a user's notification feed
await serverClient.feeds.addActivity({
  feeds: ["notification:user-123"], // Target user's notification feed
  type: "milestone", // Custom activity type
  text: "You've reached 1000 followers!",
  user_id: "user_id",
  extra_data: {
    milestone_type: "followers",
    count: 1000,
  },
});

// Add activity to custom notification feed group
await serverClient.feeds.addActivity({
  feeds: ["alerts:user-123"], // Custom notification feed group
  type: "system_alert",
  text: "Your subscription expires in 3 days",
  user_id: "user_id",
});
```

```go label="Go"
ctx := context.Background()

// Add a custom notification directly to a user's notification feed
_, err = client.Feeds().AddActivity(ctx, &getstream.AddActivityRequest{
  Feeds:  []string{"notification:john"}, // Target user's notification feed
  Type:   "milestone",                       // Custom activity type
  Text:   getstream.PtrTo("You've reached 1000 followers!"),
  UserID: getstream.PtrTo("<user id>"),
  Custom: map[string]any{
    "milestone_type": "followers",
    "count":          1000,
  },
})
if err != nil {
  log.Fatal("Error adding milestone activity:", err)
}

// Add activity to custom notification feed group
_, err = client.Feeds().AddActivity(ctx, &getstream.AddActivityRequest{
  Feeds:  []string{"alerts:john"}, // Custom notification feed group
  Type:   "system_alert",
  Text:   getstream.PtrTo("Your subscription expires in 3 days"),
  UserID: getstream.PtrTo("<user id>"),
})
if err != nil {
  log.Fatal("Error adding system alert activity:", err)
}
```

```php label="php"
use GetStream\GeneratedModels;

// Add a custom notification directly to a user's notification feed
$feedsClient->addActivity(new GeneratedModels\AddActivityRequest(
    feeds: ["notification:john"], // Target user's notification feed
    type: "milestone", // Custom activity type
    text: "You've reached 1000 followers!",
    userID: "<user id>",
    custom: (object)[
        "milestone_type" => "followers",
        "count" => 1000,
    ]
));

// Add activity to custom notification feed group
$feedsClient->addActivity(new GeneratedModels\AddActivityRequest(
    feeds: ["alerts:john"], // Custom notification feed group
    type: "system_alert",
    text: "Your subscription expires in 3 days",
    userID: "<user id>"
));
```

</Tabs>



---

This page was last updated at 2026-05-22T16:31:46.736Z.

For the most recent version of this documentation, visit [https://getstream.io/activity-feeds/docs/go-golang/push-introduction/](https://getstream.io/activity-feeds/docs/go-golang/push-introduction/).