0.0.65 • Published 1 year ago

@mycoverai/mca-react-native-sdk v0.0.65

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

mca-react-native-sdk

Official MyCover.ai SDK. Supercharge your product with MyCover AI Insurance offerings. Create embedded insurance offerings or full white label insurance applications that excite your customers.

Installation

npm install mca-react-native-sdk

Additional Setup

  • To install all necessary dependencies, run:
npm install mca-react-native-sdk react-native-screens react-native-safe-area-context react-native-svg-transformer @react-native-community/geolocation @react-native-clipboard/clipboard react-native-svg react-native-gesture-handler @react-native-community/datetimepicker @pusher/pusher-websocket-react-native lottie-react-native react-native-image-picker react-native-reanimated react-native-vision-camera react-native-orientation-locker react-native-fs

Create or Update metro.config.js & paste the following

const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');

const defaultConfig = getDefaultConfig(__dirname);
const { assetExts, sourceExts } = defaultConfig.resolver;

const config = {
  transformer: {
    babelTransformerPath: require.resolve('react-native-svg-transformer'),
  },
  resolver: {
    assetExts: assetExts.filter((ext) => ext !== 'svg'),
    sourceExts: [...sourceExts, 'svg'],
  },
};

module.exports = mergeConfig(defaultConfig, config);

Create or Update babel.config.js & paste the following

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: ['react-native-reanimated/plugin'],
};

Link the assets in your React Native project:

For React Native >= 0.60, add this to your react-native.config.js:

module.exports = {
  project: {
    ios: {},
    android: {},
  },
  assets: ['node_modules/mca-react-native-sdk/src/assets/fonts/'],
};

And run

npx react-native-asset

Android Permissions

  • In your AndroidManifest.xml, add the following permissions:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Usage

import { multiply } from 'mca-react-native-sdk';

// ...

const result = await multiply(3, 7);

Troubleshooting

  • If you encounter the following errors:
  1. Error: ViewManagerResolver returned null for either RNSScreenStackHeaderConfig or RTCTRNSScreenStackHeaderConfig

    • Fix: npm install react-native-screens
  2. Error: ViewManagerResolver returned null for RNCSafeAreaProvider

    • Fix: npm install react-native-safe-area-context

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.0.64

1 year ago

0.0.65

1 year ago

0.0.62

2 years ago

0.0.63

2 years ago

0.0.61

2 years ago

0.0.60

2 years ago

0.0.59

2 years ago

0.0.58

2 years ago

0.0.57

2 years ago

0.0.55

2 years ago

0.0.56

2 years ago

0.0.54

2 years ago

0.0.53

2 years ago

0.0.52

2 years ago

0.0.47

2 years ago

0.0.51

2 years ago

0.0.50

2 years ago

0.0.48

2 years ago

0.0.49

2 years ago

0.0.46

2 years ago

0.0.40

2 years ago

0.0.41

2 years ago

0.0.42

2 years ago

0.0.20

2 years ago

0.0.43

2 years ago

0.0.21

2 years ago

0.0.44

2 years ago

0.0.22

2 years ago

0.0.45

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.25

2 years ago

0.0.37

2 years ago

0.0.15

2 years ago

0.0.38

2 years ago

0.0.16

2 years ago

0.0.39

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.30

2 years ago

0.0.31

2 years ago

0.0.32

2 years ago

0.0.10

2 years ago

0.0.33

2 years ago

0.0.11

2 years ago

0.0.34

2 years ago

0.0.12

2 years ago

0.0.35

2 years ago

0.0.13

2 years ago

0.0.36

2 years ago

0.0.14

2 years ago

0.0.26

2 years ago

0.0.9

2 years ago

0.0.27

2 years ago

0.0.28

2 years ago

0.0.29

2 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago