Skip to content

Commit cf09468

Browse files
committed
DeviceId check on iOS
1 parent 343508e commit cf09468

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

ios/Libraries/VoipService.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ public final class VoipService: NSObject {
235235

236236
let callId = payload.callId
237237
let userId = credentials.userId
238+
let deviceId = DeviceUID.uid()
238239
let client = DDPClient()
239240
ddpClient = client
240241

@@ -251,10 +252,10 @@ public final class VoipService: NSObject {
251252
let firstArg = args.first as? [String: Any],
252253
let signalType = firstArg["type"] as? String,
253254
signalType == "notification",
254-
let notification = firstArg["notification"] as? String,
255-
notification == "hangup",
256255
let signalCallId = firstArg["callId"] as? String,
257-
signalCallId == callId
256+
signalCallId == callId,
257+
let signedContractId = firstArg["signedContractId"] as? String,
258+
signedContractId != deviceId
258259
else {
259260
return
260261
}

ios/RocketChatRN-Bridging-Header.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#import "MMKVKeyManager.h"
88
#import "Shared/RocketChat/MMKVBridge.h"
99
#import <RNBootSplash.h>
10+
#import <RNDeviceInfo/DeviceUID.h>
1011
#import <MobileCrypto/RSACrypto.h>
1112
#import <MobileCrypto/AESCrypto.h>
1213
#import <MobileCrypto/RandomUtils.h>

0 commit comments

Comments
 (0)