Skip to:
Content

BuddyPress.org

Opened 4 years ago

Last modified 11 months ago

#8368 assigned defect (bug)

bp_notifications_get_notifications_for_user should return additional objects

Reported by: shawfactor's profile shawfactor Owned by:
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version:
Component: Core Keywords: needs-patch
Cc:

Description

Right now the function bp_notifications_get_notifications_for_user returns an array with content and href objects (along with the usual other objects for the notifcation).

This means the function is only really useful in the context of a buddypress theme. Yet ideally you would connect this function to a toast library or the web push api.

So I think adding (at the very least) adding the title and some of the options for the web push api, would make this function much more versatile and useful:

https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification

Change History (7)

#1 @imath
3 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Awaiting Contributions

Why not! I'd like to see a patch about it. If someone builds a patch about it, I'll be happy to review it.

Helpful doc: https://codex.buddypress.org/participate-and-contribute/contribute-with-code/

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


3 years ago

#3 @rafiahmedd
22 months ago

@shawfactor, I will be happy to implement this feature however can you please add some more details on this? So that I can start the implemantation. I will wait for your comment. 😊

Thanks

#4 @espellcaste
18 months ago

  • Milestone changed from Awaiting Contributions to Up Next
  • Owner set to espellcaste
  • Status changed from new to assigned

#5 @imath
17 months ago

  • Milestone changed from Up Next to 12.0.0

#6 @espellcaste
16 months ago

  • Owner espellcaste deleted

#7 @imath
11 months ago

  • Milestone changed from 12.0.0 to Awaiting Contributions

As playing with the Notifications API seems to require using JavaScript, I wonder if it would be a better idea to use the BP REST API instead and eventually add the missing information to the endpoint schema: https://developer.buddypress.org/bp-rest-api/reference/screen-notifications/#schema

I'm moving this ticket out of 12.0.0 milestone for now as I believe it needs more directions:

  • What would be the title compared to the component action ? A summary of it ?
  • What would be the options ? I see there are some possibilities in the link added to the ticket's description: badge, icon, lang, etc..
Note: See TracTickets for help on using tickets.