1.1.3 • Published 3 years ago
react-native-measure-ar v1.1.3
react-native-measure-ar
Getting started
$ npm install react-native-measure-ar --save
Installation iOS ONLY
iOS Linking (You must do this - we do not yet support auto-linking)
Add the following lines to your
ios/Podfile
belowuse_react_native!(:path => config["reactNativePath"])
:pod 'ViroReact', :path => '../node_modules/@viro-community/react-viro/ios/' pod 'ViroKit_static_lib', :path => '../node_modules/@viro-community/react-viro/ios/dist/ViroRenderer/static_lib'
See this example
Install the iOS native pods by running:
$ npx pod-install
or inside the
ios
directory...$ pod install
If you are going to be doing any AR then you will need to request permissions for using the camera in the
ios/APP_NAME/info.plist
by adding the following:<key>NSCameraUsageDescription</key> <string>The camera is needed for AR functionality</string>
The
string
can be more appropriate to the needs of your app.See an example here.
You're done! You can now run
npx react-native ios
.Remember, if you are using AR, you need to run on a real device.
Usage
import MeasureAr from "react-native-measure-ar";
return (
<MeasureAr
onPolygonDetected={(polygon) => console.log(polygon)}
strings={{
help: "Wie ging das nochmal?",
restart: "Neu starten",
stepBack: "Schitt Zurück",
notSupported: "AR wird von Ihrem Gerät nicht unterstützt",
}}
TutorialViewChild={
<Text
style={{
fontSize: 12,
color: "#ffffff",
}}
>
Ich bin ein Erklärbär
</Text>
}
tutorialState={true}
options={{ minDist: 0.1, confirmAlert: true }}
/>
);
powered by ViroReact