Hi all,
Are there any examples on how to send a push notification using server sdk?
...
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.
Recommended threads
- 408Database timed out. Try adjusting you...
408 I visited to my site, but it shows: An error occurred while connecting to the server. router_bad_gateway then tried to check my site logs but it shows Dat...
- Unable to add data for "user_id" column
I am using the Appwrite database and I have a table named events. When I add a column named user_id, I am not able to save data to that column from either the A...
- Example of Rows in upsert_rows function
what is format of rows that can be passed to upsert_rows function? result = tables_db.upsert_rows( database_id = '<DATABASE_ID>', table_id = '<TABLE_I...