1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-07 10:46:24 +03:00

Move Notifications into Platform

Also add support for clearing notifications if the Platform
supports it.
This commit is contained in:
David Baker
2016-11-02 17:35:31 +00:00
parent 58c0e0e056
commit 920e3346dc
2 changed files with 70 additions and 28 deletions

View File

@@ -36,6 +36,32 @@ export default class BasePlatform {
this.errorDidOccur = errorDidOccur;
}
/**
* Returns true if the platform supports displaying
* notifications, otherwise false.
*/
supportsNotifications() : boolean {
return false;
}
/**
* Returns true if the application currently has permission
* to display notifications. Otherwise false.
*/
maySendNotifications() : boolean {
return false;
}
/**
* Requests permission to send notifications. Returns
* a promise that is resolved when the user has responded
* to the request. The promise has a single string argument
* that is 'granted' if the user allowed the request or
* 'denied' otherwise.
*/
requestNotificationPermission() : Promise {
}
displayNotification(title: string, msg: string, avatarUrl: string) {
}
}