
TypeScript
from appwrite.services.messaging import Messaging
client = Client()
(client
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
.set_project('5df5acd0d48c2') # Your project ID
.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
)
messaging = Messaging(client)
result = messaging.create_push(
message_id = '[MESSAGE_ID]',
title = '[TITLE]',
body = '[BODY]',
topics = [], # optional
users = [], # optional
targets = [], # optional
data = {}, # optional
action = '[ACTION]',# optional
icon = '[ICON]', # optional
sound = '[SOUND]', # optional
color = '[COLOR]', # optional
tag = '[TAG]', # optional
badge = '[BADGE]', # optional
draft = False, # optional
scheduled_at = '' # optional
)
the push function has options for users, How does this work? Can i put userID and send it to all Push targets associated with the user?
TL;DR
The messaging feature in the Appwrite SDK allows developers to send push notifications with various options. To send a push to a specific user, provide the user's ID in the `users` array. This will send the push notification to the targeted user.Recommended threads
- Sharing cookies
Hi, I’m using Appwrite Cloud, and I have a setup where my Appwrite backend is hosted on a subdomain (e.g., api.example.com), while my frontend (Next.js app) and...
- Custom Domain Issue
i have added a custom domain about 21 hours ago, but till now there is no SSL certificate is active on it. but if i do DNS check via https://dnschecker.org/#C...
- Flutter OAuth2 Google does not return to...
When the flow starts, the browser opens, I select an account, and it keeps showing: """ Page not found The page you're looking for doesn't exist. `general_rout...
