Back

Push notification by "users" or by "targets"?

  • 0
  • Self Hosted
  • Android
  • Messaging
arkountos
17 Feb, 2025, 22:18

Android, messaging using FCM, self-hosted 1.6.1, Python backend

Hey, I thought that by just setting the users = [<user_id>] inside the create_push() function (and not specifying a target) I could send a push notification.

I can't find anywhere how this "users" and "targets" parameters of create_push() are used, does someone know what I need to set in order to send a push notification to a user? Is it possible to skip the specifying specific targets and only list the userID (and probably the backend sends a push to all active targets?)

Thanks a lot!

TL;DR
To send a push notification to a specific user using the create_push() function, you need to specify the user_id under the users parameter. It is not necessary to specify targets. By setting users = [<user_id>], the push notification will be sent to the specified user.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more