react-activity-feed: Notifications in NotificationFeed not rendering
Trying to render out the NotificationFeed on my frontend. It is making the call to the stream api to get activities, however it’s not rendering any of them.
On backend I am using the stream-php
library adding activities that look like so:
$userFeed = $client->feed('notification', '10');
$activity_data = ['actor' => '11', 'verb' => 'follow', 'object' => '10'];
$activity_response = $userFeed->addActivity($activity_data);
10 and 11 being the user_id’s of properly initialized users
Response given from the NotificationFeed component fetching /enrich/feed/notification/10/
{
"results": [ {
"actor": "11",
"foreign_id": "",
"id": "50657f6a-eeda-11ea-a8df-128a130028af",
"object": "10",
"origin": null,
"own_reactions": {},
"reaction_counts": {},
"target": "",
"time": "2020-09-04T18:13:20.733169",
"verb": "follow"
}],
"activity_count": 1,
"actor_count": 2,
"created_at": "2020-09-04T17:54:57.297259",
"group": "follow_2020-09-04",
"id": "d0d640f7-eeda-11ea-8080-80001d8dc8c7.follow_2020-09-04",
"is_read": false,
"is_seen": false,
"updated_at": "2020-09-04T18:16:56.220491",
"verb": "follow"
}],
"next": "",
"duration": "20.18ms",
"unseen": 1,
"unread": 1
}
I get the notify
alert when a new activity is added, but none of the Notification
components are being rendered
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 15 (3 by maintainers)
I’m also running into this. Can you provide some detail on where the problem is, so maybe i could bypass it locally somehow?
@justin-snap I think the way you’re adding activities is wrong, because it’s a reference to an object we need to enrich you’ll need to specify the collection as well. In this case the
User
collection.so this would be something like this: