1
1
2
2
import '../core.dart' ;
3
3
4
- // This endpoint is undocumented. Compare zulip-mobile:
5
- // https://github.com/zulip/zulip-mobile/blob/86d94fa89/src/api/notifications/savePushToken.js
6
- // and see the server implementation:
7
- // https://github.com/zulip/zulip/blob/34ceafadd/zproject/urls.py#L383
8
- // https://github.com/zulip/zulip/blob/34ceafadd/zerver/views/push_notifications.py#L47
4
+ /// https://zulip.com/api/add-fcm-token
9
5
Future <void > registerFcmToken (ApiConnection connection, {
10
6
required String token,
11
7
}) {
@@ -14,11 +10,16 @@ Future<void> registerFcmToken(ApiConnection connection, {
14
10
});
15
11
}
16
12
17
- // This endpoint is undocumented. Compare zulip-mobile:
18
- // https://github.com/zulip/zulip-mobile/blob/86d94fa89/src/api/notifications/savePushToken.js
19
- // and see the server implementation:
20
- // https://github.com/zulip/zulip/blob/34ceafadd/zproject/urls.py#L378-L381
21
- // https://github.com/zulip/zulip/blob/34ceafadd/zerver/views/push_notifications.py#L34
13
+ /// https://zulip.com/api/remove-fcm-token
14
+ Future <void > unregisterFcmToken (ApiConnection connection, {
15
+ required String token,
16
+ }) {
17
+ return connection.delete ('unregisterFcmToken' , (_) {}, 'users/me/android_gcm_reg_id' , {
18
+ 'token' : RawParameter (token),
19
+ });
20
+ }
21
+
22
+ /// https://zulip.com/api/add-apns-token
22
23
Future <void > registerApnsToken (ApiConnection connection, {
23
24
required String token,
24
25
String ? appid,
@@ -28,3 +29,12 @@ Future<void> registerApnsToken(ApiConnection connection, {
28
29
if (appid != null ) 'appid' : RawParameter (appid),
29
30
});
30
31
}
32
+
33
+ /// https://zulip.com/api/remove-apns-token
34
+ Future <void > unregisterApnsToken (ApiConnection connection, {
35
+ required String token,
36
+ }) {
37
+ return connection.delete ('unregisterApnsToken' , (_) {}, 'users/me/apns_device_token' , {
38
+ 'token' : RawParameter (token),
39
+ });
40
+ }
0 commit comments