Hi all,
Are there any examples on how to send a push notification using server sdk?
TypeScript
...
const title = "Hello";
const contents = "This is a test";
await messaging.createPush(
sdk.ID.unique(), // messageId
title, // title
contents, // body
[], // topics
[order.user_id], // users
[], // targets
{
activity: "orders",
orderId: order.order_id!,
}, // data
"", // action
"[IMAGE]", // image <-- I don't know what's supposed to be here!
"[ICON]", // icon - <-- I don't know what's supposed to be here!
"", // sound
"F7941E", // color <-- With or without `#` sign?
"", // tag
"[BADGE]", // badge <-- I don't know what's supposed to be here!
false, // draft (optional)
"" // scheduledAt
);
...
How do I configure this to send an image and to configure the push notification icon (just like postmates, uber eats, etc...)?
Where can I get the user_id?
Any help is greatly appreciated.
TL;DR
- Developer is looking for examples on sending push notifications using the `server sdk`.
- They are unsure how to set the image and icon in the push notification configuration.
- They also seek guidance on obtaining the `user_id` for the notifications.
- To set the icon, replace the `"[ICON]"` placeholder with the URL or file path of the icon image.
- For the image, replace the `"[IMAGE]"` placeholder with the URL or file path of the image to be displayed.
- The `user_id` can be retrieved from the order information.
- Solution: Provide the URLs or file paths for the icon and imageRecommended threads
- Project Inactivity Clarification
I'm on appwrite free plan with my account (om.thakkar@ivcventure.com). Even though throughout the week we use the project atleast once to upload dynamic content...
- Retrieving Data From Backups
Hiya, I have a user requesting for data they accidentally deleted. I don't have document history built into my app. Is there a way to extract data from the auto...
- Paused project notification
Hi, how do I disable these notifications? I get them every week and they're starting to annoy me. I don't care that my project is paused.