More details and API reference: News
.publish(content, author, timestamp?)
Publish news on iPear.
More details and API reference: (out.) Publish
| Key | Type | Description |
|---|---|---|
content | string required | News content (1-512 characters) |
author | string required | Author of the content (1-64 characters) |
timestamp | number | Date (unix ms, UTC) |
Promise<string> - string is unique identifier of the news.
app.news.publish({
content: "A heat wave is expected in the next few days. Stay safe.",
author: 'Laura Quigley',
timestamp: 1672527600000
}).then((id) => {
console.log('my news id', id);
}).catch((error) => {
console.log('error', error);
});
"92003acb-b4f6-47fd-8c5d-c8eef2c7e124"
.remove(id)
Remove a news published on iPear.
More details and API reference: (out.) Remove
| Key | Type | Description |
|---|---|---|
id | string required | News identifier (36 characters) |
Promise<boolean> - Has been deleted (throw error on fail).
app.news.remove("92003acb-b4f6-47fd-8c5d-c8eef2c7e124").then((deleted) => {
console.log('news deleted:', deleted);
}).catch((error) => {
console.log('error', error);
});
true
Powered by Doctave