Skip to content

Commit e307ff3

Browse files
committed
fix: add guard for excludedCredentials
1 parent 816dd3f commit e307ff3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

ios/ReactNativePasskeysModule.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ private func prepareCrossPlatformRegistrationRequest(challenge: Data,
174174

175175
if let excludedCredentials = request.excludeCredentials {
176176
if !excludedCredentials.isEmpty {
177-
crossPlatformRegistrationRequest.excludedCredentials = excludedCredentials.map({ $0.getCrossPlatformDescriptor() })
177+
if #available(iOS 17.4, *) {
178+
crossPlatformRegistrationRequest.excludedCredentials = excludedCredentials.map({ $0.getCrossPlatformDescriptor() })
179+
}
178180
}
179181
}
180182

@@ -221,7 +223,9 @@ private func preparePlatformRegistrationRequest(challenge: Data,
221223

222224
if let excludedCredentials = request.excludeCredentials {
223225
if !excludedCredentials.isEmpty {
224-
platformKeyRegistrationRequest.excludedCredentials = excludedCredentials.map({ $0.getPlatformDescriptor() })
226+
if #available(iOS 17.4, *) {
227+
platformKeyRegistrationRequest.excludedCredentials = excludedCredentials.map({ $0.getPlatformDescriptor() })
228+
}
225229
}
226230
}
227231

0 commit comments

Comments
 (0)