Skip to content

Commit e7cc488

Browse files
committed
use MSC4174
1 parent cd02ef6 commit e7cc488

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/matrix/push/Pusher.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ export class Pusher {
5656
});
5757
}
5858

59+
static webpushPusher(appId: string, pushkey: string, data: IPusherData): Pusher {
60+
return new Pusher({
61+
kind: "webpush",
62+
append: true, // as pushkeys are shared between multiple users on one origin
63+
data,
64+
pushkey,
65+
app_id: appId,
66+
app_display_name: "Hydrogen",
67+
device_display_name: "Hydrogen",
68+
lang: "en"
69+
});
70+
}
71+
5972
static createDefaultPayload(sessionId: string): {session_id: string} {
6073
return {session_id: sessionId};
6174
}

src/platform/web/dom/NotificationService.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ export class NotificationService {
3737
events_only: true,
3838
default_payload: defaultPayload
3939
};
40-
return pusherFactory.httpPusher(
41-
this._pushConfig.gatewayUrl,
40+
return pusherFactory.webpushPusher(
4241
this._pushConfig.appId,
4342
pushkey,
4443
data

0 commit comments

Comments
 (0)