Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/notifications.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-01-25 19:51:24 +0300
committerJoas Schilling <coding@schilljs.com>2017-03-29 11:59:12 +0300
commit3164e40e5ca9cf6b80b92ac2a51c4cafae3d6ccf (patch)
treeca3adee659b52befcfc8901f535f9530a7478f11 /appinfo
parent80d830e8d088de1f84a852d4581c11fb6d41ae51 (diff)
Allow devices to register for push notifications
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'appinfo')
-rwxr-xr-xappinfo/database.xml43
-rw-r--r--appinfo/routes.php2
2 files changed, 45 insertions, 0 deletions
diff --git a/appinfo/database.xml b/appinfo/database.xml
index 66ecdcb..c9bdab8 100755
--- a/appinfo/database.xml
+++ b/appinfo/database.xml
@@ -4,6 +4,7 @@
<create>true</create>
<overwrite>false</overwrite>
<charset>utf8</charset>
+
<table>
<name>*dbprefix*notifications</name>
<declaration>
@@ -118,4 +119,46 @@
</index>
</declaration>
</table>
+
+ <table>
+ <name>*dbprefix*notifications_pushtokens</name>
+ <declaration>
+ <field>
+ <name>uid</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>64</length>
+ </field>
+ <field>
+ <name>token</name>
+ <type>integer</type>
+ <default>0</default>
+ <notnull>true</notnull>
+ <length>4</length>
+ </field>
+ <field>
+ <name>devicepublickey</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>128</length>
+ </field>
+ <field>
+ <name>pushtokenhash</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>128</length>
+ </field>
+
+ <index>
+ <name>oc_notifpushtoken</name>
+ <unique>true</unique>
+ <field>
+ <name>uid</name>
+ </field>
+ <field>
+ <name>token</name>
+ </field>
+ </index>
+ </declaration>
+ </table>
</database>
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 6c11dc3..a79e4c8 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -24,5 +24,7 @@ return [
['name' => 'Endpoint#listNotifications', 'url' => '/api/{apiVersion}/notifications', 'verb' => 'GET', 'requirements' => ['apiVersion' => 'v(1|2)']],
['name' => 'Endpoint#getNotification', 'url' => '/api/{apiVersion}/notifications/{id}', 'verb' => 'GET', 'requirements' => ['apiVersion' => 'v(1|2)', 'id' => '\d+']],
['name' => 'Endpoint#deleteNotification', 'url' => '/api/{apiVersion}/notifications/{id}', 'verb' => 'DELETE', 'requirements' => ['apiVersion' => 'v(1|2)', 'id' => '\d+']],
+ ['name' => 'Push#registerDevice', 'url' => '/api/3/push', 'verb' => 'POST'],
+ ['name' => 'Push#removeDevice', 'url' => '/api/3/push', 'verb' => 'DELETE'],
],
];