UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

42 lines (39 loc) • 1.42 kB
import { Platform } from "react-native"; import { NitroModules } from "react-native-nitro-modules"; import { rethrowNativeError } from "../nativeError.native.js"; import { DeviceAttestation as DeviceAttestation$1 } from "./unavailable.native.js"; var hybrid; function native() { if (Platform.OS !== "ios") throw new Error("DeviceAttestation requires an iOS native build"); hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = NitroModules.createHybridObject("OneDeviceAttestation"); return hybrid; } function getAvailability() { try { return native().getAvailability(); } catch (error) { return rethrowNativeError(error); } } function generateKey() { return native().generateKey().catch(rethrowNativeError); } function attestKey(keyId, clientDataHashBase64) { return native().attestKey(keyId, clientDataHashBase64).catch(rethrowNativeError); } function generateAssertion(keyId, clientDataHashBase64) { return native().generateAssertion(keyId, clientDataHashBase64).catch(rethrowNativeError); } function generateDeviceToken() { return native().generateDeviceToken().catch(rethrowNativeError); } var nativeDeviceAttestation = Object.freeze({ getAvailability, generateKey, attestKey, generateAssertion, generateDeviceToken }); var DeviceAttestation = Platform.OS === "android" ? DeviceAttestation$1 : nativeDeviceAttestation; export { DeviceAttestation }; //# sourceMappingURL=index.native.js.map