2.7.0 • Published 6 months ago

react-native-expo-metamap-sdk v2.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago
LTS version (Recommended for most users):Current Version(Latest features)
2.1.32.1.3

Install MetaMap for React Native Expo

In a terminal, use the following command to install MetaMap for React Native: 1. Install the SDK:

```bash
npm i react-native-expo-metamap-sdk
```
  1. Add the followling line to your app.json file:
    "plugins":["react-native-expo-metamap-sdk"]
  2. Run EXPO for your platform: For iOS:
    expo run:ios
    For Android:
    expo run:android

Example MetaMap React Native Implementation

The following is an example of the class Component.

import React, {Component} from 'react';
import {
  NativeModules,
  NativeEventEmitter,
  Button,
  View
} from 'react-native';

import {
  MetaMapRNSdk,
} from 'react-native-expo-metamap-sdk';

export default class App extends Component {
  constructor() {
    super();
    console.log('Constructor Called.');
  }

  componentDidMount() {
	 //set listening callbacks
  	const MetaMapVerifyResult = new NativeEventEmitter(NativeModules.MetaMapRNSdk)
 	 MetaMapVerifyResult.addListener('verificationSuccess', (data) => console.log(data))
 	 MetaMapVerifyResult.addListener('verificationCanceled', (data) => console.log(data))
  }

  //call showFlow when button is clicked
  handleMetaMapClickButton = () => {

	 //set 3 params clientId (cant be null), flowId, metadata
  	  var yourMetadata = { param1: "value1", param2: "value2" }

   	 MetaMapRNSdk.showFlow("YOUR_CLIENT_ID", "YOUR_FLOW_ID", yourMetadata);
  }

  //Add button to view graph
  render() {
    return (
      <View
        style={{
          flex: 1,
          justifyContent: 'center',
          alignItems: 'center',
          backgroundColor: 'powderblue',
        }}>
        <Button onPress={this.handleMetaMapClickButton} title="Click here"/>
      </View>
    );
  }
}

The following is an example of the Function Component.

import React, {Component, useEffect} from 'react';
import {
  NativeModules,
  NativeEventEmitter,
  Button,
  View
} from 'react-native';

import {
  MetaMapRNSdk,
} from 'react-native-expo-metamap-sdk';


function App(props) {

    useEffect(() => {
     	const MetaMapVerifyResult = new NativeEventEmitter(NativeModules.MetaMapRNSdk)
     	MetaMapVerifyResult.addListener('verificationSuccess', (data) => console.log(data))
     	MetaMapVerifyResult.addListener('verificationCanceled', (data) => console.log(data))
    })
    const handleMetaMapClickButton = (props) => {

            //set 3 params clientId (cant be null), flowId, metadata
         var yourMetadata = { param1: "value1", param2: "value2" }
       	 MetaMapRNSdk.showFlow("610b96fb7cc893001b135505", "611101668083a1001b13cc80", yourMetadata);
      }

    return (
          <View
            style={{
              flex: 1,
              justifyContent: 'center',
              alignItems: 'center',
              backgroundColor: 'powderblue',
            }}>
            <Button onPress = {() => handleMetaMapClickButton()}  title="Click here"/>
          </View>
        );
}
export default App;

Metadata is an additional optional parameter that can be used to replace certain settings:

Set the Language:

By default the SDK language is set to "en" but it is editable to the language from the list: "es", "fr", "pt", "ru", "tr", "de", "it", "pl", "th".

metaData: {"fixedLanguage": "value"}

Set the Button Color

By default main button color is white but it is editable by using hex Color format "hexColor".

metaData: {"buttonColor": "value"}

Set the Title color of the button:

By default main button title color is black but it is editable by using hex Color format "hexColor".

metaData: {"buttonTextColor": "hexColor"}

Set identity Id as parameter for re-verification:

metadata: {"identityId": "value"}

Set encryption Configuration Id as parameter for encrypting data.

metaData: ["encryptionConfigurationId": "value"]

Some error codes you may get during integration

402 - MetaMap services are not paid: please contact your customer success manager

403 - MetaMap credentials issues: please check your client id and MetaMap id

2.6.11

6 months ago

2.6.10

6 months ago

2.5.6

8 months ago

2.5.5

8 months ago

2.5.8

7 months ago

2.5.7

8 months ago

2.5.9

7 months ago

2.7.0

6 months ago

2.6.1

7 months ago

2.6.0

7 months ago

2.6.2

7 months ago

2.5.14

7 months ago

2.5.15

7 months ago

2.5.10

7 months ago

2.5.11

7 months ago

2.5.12

7 months ago

2.5.13

7 months ago

2.5.0

8 months ago

2.5.2

8 months ago

2.5.1

8 months ago

2.5.3

8 months ago

2.6.5

7 months ago

2.6.7

7 months ago

2.6.6

7 months ago

2.6.9

6 months ago

2.6.8

6 months ago

2.4.10

10 months ago

2.4.11

10 months ago

2.4.9

10 months ago

2.4.8

10 months ago

2.4.3

10 months ago

2.4.5

10 months ago

2.4.4

10 months ago

2.4.6

10 months ago

2.4.1

1 year ago

2.4.0

1 year ago

2.4.2

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.3.4

1 year ago

2.3.3

1 year ago

2.3.6

1 year ago

2.3.5

1 year ago

2.3.0

2 years ago

2.2.6

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.2.1

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.0

2 years ago

2.1.3

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.8

2 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.9.0

3 years ago

2.0.15

2 years ago

2.0.13

2 years ago

2.0.14

2 years ago

2.0.11

2 years ago

2.0.12

2 years ago

2.0.10

2 years ago

2.1.0

2 years ago

1.7.3

3 years ago

1.7.2

3 years ago

1.8.0

3 years ago

1.7.7

3 years ago

1.7.6

3 years ago

1.7.5

3 years ago

1.7.4

3 years ago

1.2.0

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.4.3

3 years ago

1.6.0

3 years ago

1.5.1

3 years ago

1.4.2

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.1.0

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.30

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.13

3 years ago