Skip to content

Commit 4866fb6

Browse files
authored
Add passkey.isSupported method (#56)
1 parent 76aa40c commit 4866fb6

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-authsignal",
3-
"version": "1.5.0",
3+
"version": "1.6.0",
44
"description": "The official Authsignal React Native library.",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

src/passkey.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,19 @@ export class AuthsignalPasskey {
133133
}
134134
}
135135

136+
isSupported(): boolean {
137+
if (Platform.OS === 'android') {
138+
return Platform.Version >= 28;
139+
} else if (Platform.OS === 'ios') {
140+
return parseInt(Platform.Version, 10) >= 15;
141+
} else {
142+
return false;
143+
}
144+
}
145+
146+
/**
147+
* @deprecated Use 'preferImmediatelyAvailableCredentials' to control what happens when a passkey isn't available.
148+
*/
136149
async isAvailableOnDevice(): Promise<boolean> {
137150
await this.ensureModuleIsInitialized();
138151

0 commit comments

Comments
 (0)