Andy02
(Andy)
1
My site spans a few platforms.
I know users can have live browser notifications, and emails.
I’d also like to pull the notifications bubble that appears on discourse user profile and add it to the menu on my other platforms, for continuity.
Just that they have a notification, and ideally how many. Has anyone heard of that being done?
「いいね!」 3
Falco
(Falco)
2
Yeah, this is totally doable.
I did back in 2015 using a direct database connection on the Discourse and querying the notifications table.
You can also use the API.
It’s just a matter of picking what’s best for the underlying tech of the other site.
「いいね!」 6
これを実装し、Discourse の未読通知数を他のサイトへ問題なく取得できるようになりました。
現在直面している課題は、他のサイトと Discourse でバッジの表示数が一致しないことです。
青色のバッジ(通知)については、ユーザーが Discourse でドロップダウンを開くと、通知そのものを開いていなくてもカウンターが 0 にリセットされます。
一方、当社の他のウェブサイトでは、通知は未読としてカウントされ続けます。そのため、他のサイトでは「X 件の未読通知」と表示されているにもかかわらず、Discourse 側ではカウンターが 0 にリセットされている可能性があります。
これはユーザーにとって非常に混乱を招きます。未読通知の数ではなく、Discourse の青色バッジに表示される数(ユーザーが通知ドロップダウンを開くと 0 に設定される数)を取得することは可能でしょうか?