-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathindex.ios.js
34 lines (27 loc) · 822 Bytes
/
index.ios.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { NativeModules } from 'react-native'
import invariant from 'invariant'
const { RNWebRTCARSession } = NativeModules
if (RNWebRTCARSession) {
RNWebRTCARSession.init()
}
const checkNativeModule = () =>
invariant(
RNWebRTCARSession,
'Native Module `react-native-webrtc-ar-session` is not linked.',
)
export const startCapturingARView = (options = {}) => {
checkNativeModule()
return RNWebRTCARSession.startSession(options)
}
export const stopCapturingARView = () => {
checkNativeModule()
return RNWebRTCARSession.stopSession()
}
export const isARWorldTrackingSupported = () => {
checkNativeModule()
return !!RNWebRTCARSession.AR_WORLD_TRACKING_SUPPORTED
}
export const isARFaceTrackingSupported = () => {
checkNativeModule()
return !!RNWebRTCARSession.AR_FACE_TRACKING_SUPPORTED
}