1.0.0 • Published 4 years ago

react-native-vouched v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

How to use component in clients

Note! For development, see SDK Development section.

Pre-reqs

General

  • Tested React Native version is 0.61.5. Versions 0.59+ should also work.
  • Project must be using Podfile.
  • Minimal platform version is 10

Component

yarn install react-native-vouched

If not auto-linked, put in Podfile

pod 'react-native-vouched', :path => '../react-native-vouched.podspec'

and then

pod install

Swift. If not already done, you should setup your XCode project for Swift by opening (or creating dummy) Swift source file. Otherwise you'll get an error duing XCode compilation Unable to determine Swift version.

Also, In case of Could not find or use auto-linked library 'swiftFoundation', you need to add Swift Libraries to the project, https://stackoverflow.com/questions/52536380/why-linker-link-static-libraries-with-errors-ios Alternatively, create dummy Swift source file.

Peer dependencies

yarn add react-native-image-picker react-native-vector-icons react-native-camera

If not auto-linked, put in Podfile:

  pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  pod 'react-native-camera', :path => '../node_modules/react-native-camera'

and then

pod install

For react-native-vector-icons, if you get Unrecognized font family FontAwesome, you may also need to add this to Info.plist:

	<key>UIAppFonts</key>
	<array>
		<string>AntDesign.ttf</string>
		<string>Entypo.ttf</string>
		<string>EvilIcons.ttf</string>
		<string>Feather.ttf</string>
		<string>FontAwesome.ttf</string>
		<string>FontAwesome5_Brands.ttf</string>
		<string>FontAwesome5_Regular.ttf</string>
		<string>FontAwesome5_Solid.ttf</string>
		<string>Fontisto.ttf</string>
		<string>Foundation.ttf</string>
		<string>Ionicons.ttf</string>
		<string>MaterialCommunityIcons.ttf</string>
		<string>MaterialIcons.ttf</string>
		<string>Octicons.ttf</string>
		<string>SimpleLineIcons.ttf</string>
		<string>Zocial.ttf</string>
	</array>

For image picker and camera, you need to add permission text in Info.plist:

    <key>NSPhotoLibraryUsageDescription</key>
    <string>$(PRODUCT_NAME) would like access to your photo gallery</string>
    <key>NSCameraUsageDescription</key>
    <string>Your message to user when the camera is accessed for the first time</string>

Tested versions are

    "react-native-image-picker": "^2.0.0",
    "react-native-vector-icons": "^6.6.0"
    "react-native-camera": "^3.15.1",

Models

Download model files inference_graph.tflite and labelmap_mobilenet_card.txt and place them in ios/Models directory. Make sure files are added to XCode project.

Usage

import {Vouched} from 'react-native-vouched';

const config = {
  appId: <Your app id>
  ...other configuration props
};

return (
    <Vouched config={config}/>
)

SDK Development

Checkout sources

Install deps

  1. cd example
  2. yarn install

Launch example

  1. cd example
  2. yarn start
  3. yarn ios

After each change in library

  1. Build library yarn build in root
  2. Stop example bundler
  3. rm -fr ./node_modules/react-native-vouched
  4. yarn add react-native-vouched@file:../
  5. Start example bundler.

Troubleshooting

1.

error: bundling failed: Error: Unable to resolve module `warnOnce` from `node_modules/react-native-vouched/node_modules/react-native/Libraries/react-native/react-native-implementation.js`: warnOnce could not be found within the project.

Development dependencies of react-native-vouched were installed and conflicts with deps of the client code. Reinstall client packages.