Eden
Eden
NNovu
Created by Eden on 9/3/2024 in #💬│support
Payload.data isn't passed to FE
from Fe package.json:
"@novu/framework": "^2.0.0",
from service package.json:
"@novu/react": "2.0.0-canary.3",
from Fe package.json:
"@novu/framework": "^2.0.0",
from service package.json:
"@novu/react": "2.0.0-canary.3",
14 replies
NNovu
Created by Eden on 9/3/2024 in #💬│support
Payload.data isn't passed to FE
return {
body: jsonDocument,
subject: controls.subject ?? `${mentionedByName} mentioned you in a comment`,
data: {
someParam: 'someValue',
url: addCommentId(comment.url ?? '', comment.id),
},
};
return {
body: jsonDocument,
subject: controls.subject ?? `${mentionedByName} mentioned you in a comment`,
data: {
someParam: 'someValue',
url: addCommentId(comment.url ?? '', comment.id),
},
};
I even added some hard coded params in my
inApp()
inApp()
workflow
14 replies
NNovu
Created by Eden on 9/3/2024 in #💬│support
Payload.data isn't passed to FE
No description
14 replies
NNovu
Created by Eden on 9/3/2024 in #💬│support
Payload.data isn't passed to FE
I am using: "@novu/react": "^2.0.0-canary.3", Just tested again and made sure i have the correct version
14 replies
NNovu
Created by Eden on 8/25/2024 in #💬│support
primaryAction.url doesn't seem to be working with the new notificationCenter
@Pawan Jain Also, please lmk if i should open a new ticket for it
20 replies
NNovu
Created by Eden on 8/25/2024 in #💬│support
primaryAction.url doesn't seem to be working with the new notificationCenter
@Pawan Jain updated my comment 🙏
20 replies
NNovu
Created by Eden on 8/25/2024 in #💬│support
primaryAction.url doesn't seem to be working with the new notificationCenter
@Pawan Jain I'm sorry to bother you again, but the bug has not been fixed as far as i'm noticing, can you please try and reproduce? here's my updated code:
await step.inApp(
'send-mention-notification',
async () => {

return {
body: jsonDocument,
subject: controls.subject ?? `${mentionedByName} mentioned you in a comment`,
data: {
url: getCommentUrl(comment.url ?? '', comment.id),
},
};
},
{
skip: async () => shouldSkipMentionWorkflow(payload),
},
);
},
await step.inApp(
'send-mention-notification',
async () => {

return {
body: jsonDocument,
subject: controls.subject ?? `${mentionedByName} mentioned you in a comment`,
data: {
url: getCommentUrl(comment.url ?? '', comment.id),
},
};
},
{
skip: async () => shouldSkipMentionWorkflow(payload),
},
);
},
<Inbox
applicationIdentifier={novuApplicationIdentifier}
subscriberId={userId}
appearance={appearance}
renderNotification={(notification) => {
console.log('Notification received', JSON.stringify(notification));
return (
<div>
<h3>{notification.subject}</h3>
<p>{notification.body}</p>
</div>
);
}}
/>
<Inbox
applicationIdentifier={novuApplicationIdentifier}
subscriberId={userId}
appearance={appearance}
renderNotification={(notification) => {
console.log('Notification received', JSON.stringify(notification));
return (
<div>
<h3>{notification.subject}</h3>
<p>{notification.body}</p>
</div>
);
}}
/>
And here's my FE console.log: Notification received {"notification":
{
"notification":{
"id":"66d598377b008e3d36f88668",
"subject":"Eden Lender mentioned you in a comment",
"body":"wow let's go Totally different person Another Person Eden Lender",
"to":{
"id":"66bca3ac9314a600ef264457",
"subscriberId":"607a88f8-bfc4-4675-83c6-f1a9894cd797"
},
"isRead":true,
"isArchived":false,
"createdAt":"2024-09-02T10:49:27.551Z",
"readAt":"2024-09-02T10:49:33.945Z",
"channelType":"in_app",
"tags":[

]
}
}
{
"notification":{
"id":"66d598377b008e3d36f88668",
"subject":"Eden Lender mentioned you in a comment",
"body":"wow let's go Totally different person Another Person Eden Lender",
"to":{
"id":"66bca3ac9314a600ef264457",
"subscriberId":"607a88f8-bfc4-4675-83c6-f1a9894cd797"
},
"isRead":true,
"isArchived":false,
"createdAt":"2024-09-02T10:49:27.551Z",
"readAt":"2024-09-02T10:49:33.945Z",
"channelType":"in_app",
"tags":[

]
}
}
20 replies
NNovu
Created by Eden on 8/25/2024 in #💬│support
primaryAction.url doesn't seem to be working with the new notificationCenter
@Pawan Jain Thx so much, this really helps
20 replies
NNovu
Created by Eden on 8/25/2024 in #💬│support
primaryAction.url doesn't seem to be working with the new notificationCenter
The above pr fixes my need for someOtherValue' // this will also not go through and thank you for the update about the url, i'd appriciate your help and would love to know when i can try it and show my team.
20 replies
NNovu
Created by Eden on 8/25/2024 in #💬│support
primaryAction.url doesn't seem to be working with the new notificationCenter
@Pawan Jain Looks like it'll fit, i still hope that if primaryAction.url is a built in feature, it will be fixed for ease of use, but for my use-case a custom data object will do the trick. 🙏
20 replies
NNovu
Created by Eden on 8/25/2024 in #💬│support
primaryAction.url doesn't seem to be working with the new notificationCenter
@Pawan Jain First of all, thank you so much for looking into this. I'd love to know if custom data is/will be supported soon, since it's a base requirement for us to use the NotificationCenter Thx again 🙏
20 replies
NNovu
Created by Eden on 8/25/2024 in #💬│support
primaryAction.url doesn't seem to be working with the new notificationCenter
@DevRel @Support ❤️
20 replies
NNovu
Created by Eden on 8/25/2024 in #💬│support
primaryAction.url doesn't seem to be working with the new notificationCenter
Here's my frontend code i test with 🙏
const onNotificationClick = useCallback((thing) => {
console.log(JSON.stringify({ thing }));
}, []);

return (
<Inbox
applicationIdentifier={'myIdentifier'}
subscriberId={userId}
appearance={appearance}
onPrimaryActionClick={onNotificationClick}
onSecondaryActionClick={onNotificationClick}
// renderBell={(props) => props.unreadCount}
/>
);

log:
{
"thing":{
"notification":{
"id":"myId",
"subject":"someone tagged you in a post",
"body":"someone tagged you in a post",
"to":{
"id":"",
"subscriberId":""
},
"isRead":true,
"isArchived":false,
"createdAt":"2024-08-26T08:51:24.808Z",
"readAt":"2024-08-26T08:52:01.621Z",
"primaryAction":{
"label":"View Comment",
// no url
"isCompleted":false
},
"secondaryAction":{
"label":"Dismiss",
"isCompleted":true
},
"channelType":"in_app",
"tags":[

]
}
}
}
const onNotificationClick = useCallback((thing) => {
console.log(JSON.stringify({ thing }));
}, []);

return (
<Inbox
applicationIdentifier={'myIdentifier'}
subscriberId={userId}
appearance={appearance}
onPrimaryActionClick={onNotificationClick}
onSecondaryActionClick={onNotificationClick}
// renderBell={(props) => props.unreadCount}
/>
);

log:
{
"thing":{
"notification":{
"id":"myId",
"subject":"someone tagged you in a post",
"body":"someone tagged you in a post",
"to":{
"id":"",
"subscriberId":""
},
"isRead":true,
"isArchived":false,
"createdAt":"2024-08-26T08:51:24.808Z",
"readAt":"2024-08-26T08:52:01.621Z",
"primaryAction":{
"label":"View Comment",
// no url
"isCompleted":false
},
"secondaryAction":{
"label":"Dismiss",
"isCompleted":true
},
"channelType":"in_app",
"tags":[

]
}
}
}
20 replies