Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a9fcf32
chore: accept additional push tokens intended for voip to iOS devices
pierre-lehnen-rc Feb 27, 2026
8f27671
configure apn and voip tokens on the same request
pierre-lehnen-rc Mar 5, 2026
8a525cb
use API.v1.failure
pierre-lehnen-rc Mar 5, 2026
453508e
this was no longer needed
pierre-lehnen-rc Mar 5, 2026
0eaeee8
feat: send push notifications for voice calls
pierre-lehnen-rc Mar 5, 2026
43b8434
state change notifications
pierre-lehnen-rc Mar 6, 2026
380f0e7
shrink changes
pierre-lehnen-rc Mar 6, 2026
d990aca
use UUIDs
pierre-lehnen-rc Mar 6, 2026
424406a
add createdAt to voip push notification payload
pierre-lehnen-rc Mar 9, 2026
b066854
Merge branch 'develop' into feat/voip-send-push
pierre-lehnen-rc Mar 9, 2026
cb4338f
code review
pierre-lehnen-rc Mar 9, 2026
7096fdf
more changes from code review
pierre-lehnen-rc Mar 9, 2026
021bb35
adjust maxRetries
pierre-lehnen-rc Mar 9, 2026
36adc1f
import meteor explicitly
pierre-lehnen-rc Mar 9, 2026
395f8ad
LSP crashed once again
pierre-lehnen-rc Mar 9, 2026
65c07d6
add caller username to push payload
pierre-lehnen-rc Mar 10, 2026
1109b45
Merge branch 'develop' into feat/voip-send-push
pierre-lehnen-rc Mar 10, 2026
533d805
add call kind to the notification payload
pierre-lehnen-rc Mar 10, 2026
a976955
Update apps/meteor/server/services/media-call/logger.ts
pierre-lehnen-rc Mar 11, 2026
ea7c0b4
Merge branch 'develop' into feat/voip-send-push
pierre-lehnen-rc Mar 23, 2026
38d455b
changes to signaling lib to support accepting a call received via push
pierre-lehnen-rc Mar 23, 2026
aa49ca4
merge error
pierre-lehnen-rc Mar 23, 2026
a484534
use an agent event for the trying signal
pierre-lehnen-rc Mar 25, 2026
89670cf
add expirationSeconds param to apn notifications
pierre-lehnen-rc Mar 25, 2026
8301f27
filter report of active calls to list only calls signed to that session
pierre-lehnen-rc Mar 25, 2026
3bdd500
invalid type
pierre-lehnen-rc Apr 6, 2026
e815db6
removed register event and notification
pierre-lehnen-rc Apr 7, 2026
3a3e7e9
feat: new endpoint to get the current media state from the server
pierre-lehnen-rc Apr 8, 2026
bbd6e94
split the endpoint in two
pierre-lehnen-rc Apr 9, 2026
821d79e
add param to not load initial state signals via websocket
pierre-lehnen-rc Apr 9, 2026
6c22bb4
ensure that potentially repeated signals won't revert the call state
pierre-lehnen-rc Apr 9, 2026
181a3ca
imported registration changes from the voip push PR
pierre-lehnen-rc Apr 10, 2026
ecd12e7
add changeset
pierre-lehnen-rc Apr 13, 2026
d9bb207
applying changes from code review
pierre-lehnen-rc Apr 13, 2026
8b23099
Merge branch 'feat/voip-rest-state' into feat/voip-send-push
pierre-lehnen-rc Apr 13, 2026
e977ad2
fix type
pierre-lehnen-rc Apr 13, 2026
5ef5cbc
Merge branch 'feat/voip-rest-state' into feat/voip-send-push
pierre-lehnen-rc Apr 13, 2026
0693f21
add setting and validations for sending push notifications
pierre-lehnen-rc Apr 13, 2026
50d49ae
removing dead code left by previous merge
pierre-lehnen-rc Apr 13, 2026
22cfeed
do not send trying signals for active calls
pierre-lehnen-rc Apr 13, 2026
7bbc344
Merge branch 'develop' into feat/voip-send-push
pierre-lehnen-rc Apr 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/meteor/app/api/server/v1/push.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Push } from '@rocket.chat/core-services';
import { pushTokenTypes } from '@rocket.chat/core-typings';
import type { IPushToken, IPushTokenTypes } from '@rocket.chat/core-typings';
import { Messages, PushToken, Users, Rooms, Settings } from '@rocket.chat/models';
import {
Expand Down Expand Up @@ -38,7 +39,7 @@ const PushTokenPOSTSchema: JSONSchemaType<PushTokenPOST> = {
},
type: {
type: 'string',
enum: ['apn', 'gcm'],
enum: pushTokenTypes,
},
value: {
type: 'string',
Expand Down Expand Up @@ -148,6 +149,7 @@ const pushTokenEndpoints = API.v1
},
voipToken: {
type: 'string',
nullable: true,
},
},
additionalProperties: false,
Expand Down
34 changes: 24 additions & 10 deletions apps/meteor/app/push/server/apn.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import apn from '@parse/node-apn';
import type { IPushToken, RequiredField } from '@rocket.chat/core-typings';
import type { RequiredField } from '@rocket.chat/core-typings';
import EJSON from 'ejson';

import type { PushOptions, PendingPushNotification } from './definition';
Expand All @@ -24,7 +24,7 @@ export const sendAPN = ({
}: {
userToken: string;
notification: PendingPushNotification & { topic: string };
_removeToken: (token: IPushToken['token']) => void;
_removeToken: (token: string) => void;
}) => {
if (!apnConnection) {
throw new Error('Apn Connection not initialized.');
Expand All @@ -34,7 +34,15 @@ export const sendAPN = ({

const note = new apn.Notification();

note.expiry = Math.floor(Date.now() / 1000) + 3600; // Expires 1 hour from now.
// Expires 1 hour from now, unless configured otherwise.
const expirationSeconds = notification.apn?.expirationSeconds ?? 3600;

if (notification.useVoipToken) {
note.pushType = 'voip';
}

note.expiry = Math.floor(Date.now() / 1000) + expirationSeconds;

if (notification.badge !== undefined) {
note.badge = notification.badge;
}
Expand All @@ -50,10 +58,16 @@ export const sendAPN = ({
// adds category support for iOS8 custom actions as described here:
// https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/
// RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW36
note.category = notification.apn?.category;
if (notification.apn?.category) {
note.category = notification.apn.category;
}

note.body = notification.text;
note.title = notification.title;
if (notification.text) {
note.body = notification.text;
}
if (notification.title) {
note.title = notification.title;
}

if (notification.notId != null) {
note.threadId = String(notification.notId);
Expand All @@ -62,7 +76,9 @@ export const sendAPN = ({
// Allow the user to set payload data
note.payload = notification.payload ? { ejson: EJSON.stringify(notification.payload) } : {};

note.payload.messageFrom = notification.from;
if (notification.from) {
note.payload.messageFrom = notification.from;
}
note.priority = priority;

note.topic = notification.topic;
Expand All @@ -81,9 +97,7 @@ export const sendAPN = ({
msg: 'Removing APN token',
token: userToken,
});
_removeToken({
apn: userToken,
});
_removeToken(userToken);
}
});
});
Expand Down
8 changes: 5 additions & 3 deletions apps/meteor/app/push/server/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ export type PushOptions = {
};

export type PendingPushNotification = {
from: string;
title: string;
text: string;
from?: string;
title?: string;
text?: string;
badge?: number;
sound?: string;
notId?: number;
apn?: {
category?: string;
expirationSeconds?: number;
};
gcm?: {
style?: string;
Expand All @@ -42,4 +43,5 @@ export type PendingPushNotification = {
priority?: number;

contentAvailable?: 1 | 0;
useVoipToken?: boolean;
};
12 changes: 6 additions & 6 deletions apps/meteor/app/push/server/fcm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import type { NativeNotificationParameters } from './push';
type FCMDataField = Record<string, any>;

type FCMNotificationField = {
title: string;
body: string;
title?: string;
body?: string;
image?: string;
};

Expand Down Expand Up @@ -140,13 +140,13 @@ function getFCMMessagesFromPushData(userTokens: string[], notification: PendingP

// then we will create the notification field
const notificationField: FCMNotificationField = {
title: notification.title,
body: notification.text,
...(notification.title && { title: notification.title }),
...(notification.text && { body: notification.text }),
};

// then we will create the message
const message: FCMMessage = {
notification: notificationField,
...(Object.keys(notificationField).length && { notification: notificationField }),
data,
android: {
priority: 'HIGH',
Expand Down Expand Up @@ -185,7 +185,7 @@ export const sendFCM = function ({ userTokens, notification, _removeToken, optio

const removeToken = () => {
const { token } = fcmRequest.message;
token && _removeToken({ gcm: token });
token && _removeToken(token);
};

const response = fetchWithRetry(url, removeToken, {
Expand Down
Loading
Loading