Set up once
- Create the app and finish the setup for each platform you ship: web, Android, iPhone.
- Link every device after sign-in, and unlink it on sign-out.
- Turn on the social recipes, in the console under Push, Journeys, or with one call each.
- Add a webhook for
notification.openedif the product's own analytics should see which notifications bring people back. The server page shows how to verify it.
Triggers
| When this happens | Your server sends | What the person gets |
|---|---|---|
| Someone follows Maya | user.followed with user_id:"maya", actor_id, actor_name | new_follower: Jordan and 4 others started following you |
| Someone likes her post | post.liked with post_id, post_title, post_url | likes: one notification per post that updates, Sam and 11 others liked your post |
| Someone comments on it | post.commented with comment_id and text | comments: grouped per post, the latest comment as the text |
| Someone replies to her comment | comment.replied | replies: grouped per comment |
| Someone mentions her | user.mentioned with context_id and text | mentions: sent at once, threaded per conversation |
| Someone shares her post | post.shared | shares: grouped per post |
| A direct message arrives | message.received with conversation_id and preview | direct_messages: one notification per conversation, held back while she is in the app |
| She opens the app | session.started | re_engagement waits for a quiet week, with marketing consent |
Every event is a POST /events with the person who should hear about it in user_id, as the product's own user id. The event schema has the properties for each.
POST https://api.bolrach.com/push/v1/events
{ "app_id": "YOUR_APP_ID", "name": "post.liked", "user_id": "maya", "idempotency_key": "like-p91-by-sam",
"properties": { "actor_id": "sam", "actor_name": "Sam", "post_id": "p-91",
"post_title": "Saturday farmers market", "post_url": "https://social.example.com/p/91" } }When the idempotency_key comes from the product's own ids, a double tap or a retried job counts once.
Turn the recipes on
POST https://api.bolrach.com/push/v1/apps/YOUR_APP_ID/recipes/likes:enable
POST https://api.bolrach.com/push/v1/apps/YOUR_APP_ID/recipes/new_follower:enable
POST https://api.bolrach.com/push/v1/apps/YOUR_APP_ID/recipes/comments:enable
POST https://api.bolrach.com/push/v1/apps/YOUR_APP_ID/recipes/direct_messages:enableEach call publishes a journey with sensible defaults. For an audience that would rather get one evening summary, turn on activity_digest in place of the three instant recipes. It collects the day's likes, comments and follows into a single push.
Let people choose
Each social recipe tags its sends with a category, such as social_likes for likes and social_messages for chats; the journeys guide has all five. Put them in the preference centre and Maya can keep message alerts while switching off likes. One post, conversation or person is muted with PUT /apps/{id}/users/{user}/mutes/{key}, and the unread count for an in-app bell comes from GET /apps/{id}/users/{user}/badge.