0.0.43 • Published 4 years ago
react-native-keyri-sdk v0.0.43
INSTALLATION
:exclamation: Before using the Keyri SDK, you must install a number of dependencie.
To install the stable version:
npm install react-native-keyri-sdk @react-native-async-storage/async-storage react-native-camera react-native-device-info react-native-linear-gradient react-native-qrcode-scanner react-native-sensitive-infoor if you are using yarn
yarn add react-native-keyri-sdk @react-native-async-storage/async-storage react-native-device-info react-native-camera react-native-linear-gradient react-native-qrcode-scanner react-native-sensitive-infoAnd put the line in your package.json file depending:
"react-native-sodium": "https://github.com/glancemoney/react-native-sodium"`Your dependencies will look approximately (package versions may differ from the example):
"dependencies": {
....
"@react-native-async-storage/async-storage": "^1.15.5",
"react": "17.0.1",
"react-native": "0.64.1",
"react-native-camera": "^3.44.3",
"react-native-device-info": "^8.1.3",
"react-native-keyri-sdk": "^0.0.4",
"react-native-linear-gradient": "^2.5.6",
"react-native-permissions": "^3.0.5",
"react-native-qrcode-scanner": "^1.5.4",
"react-native-sensitive-info": "^5.5.8",
"react-native-sodium": "https://github.com/glancemoney/react-native-sodium"
....
}Please insert the following line in android/app/build.gradle inside defaultConfig block either:
missingDimensionStrategy 'react-native-camera', 'general'USAGE
import React from "react";
import { SafeAreaView, useColorScheme } from "react-native";
import { Colors } from "react-native/Libraries/NewAppScreen";
import Keyri from "react-native-keyri-sdk";
const App: React.FC = () => {
const isDarkMode = useColorScheme() === "dark";
const backgroundStyle = {
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
};
return (
<SafeAreaView style={backgroundStyle}>
<Keyri apiKey="your service api key" />
</SafeAreaView>
);
};START :iphone:
:one: Start Metro
npm startor if you are using yarn
yarn start:two: Start on device
(in new terminal)
for start application on android
npm run androidor if you are using yarn
yarn androidfor start apllication on iOS
npm run iosor
yarn iosHappy hacking! :smiley:
REQUIRED OPTIONS
| option | type | description |
|---|---|---|
| apiKey | string | Api key of your service. Can be viewed on the Admin page for users who have registered or authenticated on Keyri |