0.0.43 • Published 3 years ago

react-native-keyri-sdk v0.0.43

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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-info

or 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-info

And 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 start

or if you are using yarn

yarn start

:two: Start on device

(in new terminal)

for start application on android

npm run android

or if you are using yarn

yarn android

for start apllication on iOS

npm run ios

or

yarn ios

Happy hacking! :smiley:

REQUIRED OPTIONS

optiontypedescription
apiKeystringApi key of your service. Can be viewed on the Admin page for users who have registered or authenticated on Keyri