3.0.2 • Published 9 months ago

@bnnsoftvn/mobile-sic-sdk v3.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@bnnsoftvn/mobilesdk

B1 Tạo mới một Project React Native

$ npx react-native init MyApp

$ cd MyApp

$ npm i @bnnsoftvn/mobile-sic-sdk

$ npm i @bnnsoftvn/react-native-biometrics-sic

$ npm i react-native-device-info

B2 example code

import { GenerateSad_V2 } from '@bnnsoftvn/mobile-sic-sdk';
import DeviceInfo from 'react-native-device-info';
import React, { useState } from 'react';
import { TouchableOpacity, Text, View, StyleSheet, ActivityIndicator } from 'react-native';

const App = () => {
  const [loading, setLoading] = useState(false);

  // Async function to fetch data
  const handlePress = async () => {
    setLoading(true);
    try {
      var uniqueId = DeviceInfo.getUniqueId();
        var json = {
            "userid": "122280280231231",
            "deviceid": uniqueId,
            "format": 1,
            "sad": "eyJ0cmFuc2FjdGlvbl9pZCI6ImQ3YWUxM2FiLTVhNDQtNGUxMS1hOGZjLWEzOGZjODgxZThmNCIsIm9yaWdpbmF0b3JfaWQiOiJOZ3V54buFbiBWxINuIFRlc3QiLCJ1c2VyX2lkIjoiUElEWTlKVlhKT0hYN04iLCJjZXJ0aWZpY2F0ZV9pZCI6Ijg3NTkwQjI1NTkyNjQxNjIyQkQ2RTQ0ODgxNjEzNDY2MkQxNzZBRCIsInNhbHQiOiJiMjk3N2ZhMy1hZWUzLTQyZDYtYmE2Zi02OTQ2ZmZmZTFiNzMiLCJkZXZpY2VfaWQiOiJkNWs5MmJYdlFoZXVuWFhEcUdtSG44OkFQQTkxYkc1SDFLbjg3Z293TnM1U0RGSDRrc0ZQWXBUbjBjZ1U2WmgtdERBdFdnOHdPdmhnX3RBZ3N0X1RlRmNxa3NxWXc5WXFXekg5WmdoV3drQ2dodmpTaWx3YnE5a1lKWVFjY1VBYkJrZDlGaE9IejdrQzJvIiwibnVtYmVyX3NpZ25hdHVyZXMiOjEsImRvY3VtZW50cyI6W1tbW11dLFtbXV1dXSwidmFsaWRpdHlfcGVyaW9kIjp7InZhbGlkX2Zyb20iOltdLCJ2YWxpZF90byI6W119fQ"
          }
          console.log(GenerateSad_V2);
          var sig = await GenerateSad_V2(json);
          console.log(sig);
    } catch (error) {
      console.log('Error fetching data');
    }
    setLoading(false);
  };

  return (
    <View style={styles.container}>
      <TouchableOpacity style={styles.button} onPress={handlePress} disabled={loading}>
        {loading ? <ActivityIndicator color="#fff" /> : <Text style={styles.buttonText}>Fetch Data</Text>}
      </TouchableOpacity>
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
  button: {
    backgroundColor: '#007BFF',
    paddingVertical: 12,
    paddingHorizontal: 20,
    borderRadius: 8,
  },
  buttonText: {
    color: '#fff',
    fontSize: 16,
  },
});

export default App;

B3 Start App

$ npx react-native start

3.0.2

9 months ago

3.0.1

9 months ago

3.0.0

9 months ago

2.13.6

9 months ago

2.13.5

9 months ago

2.13.4

9 months ago

2.13.2

9 months ago

2.13.1

9 months ago

2.13.0

9 months ago

2.12.5

9 months ago

2.12.4

9 months ago

2.12.3

9 months ago

2.12.2

9 months ago

2.12.1

9 months ago

2.12.0

9 months ago

2.11.9

9 months ago

2.11.8

9 months ago

2.11.7

9 months ago

2.11.6

9 months ago

2.11.5

9 months ago

2.9.1

9 months ago

2.11.4

9 months ago

2.11.3

9 months ago

2.11.2

9 months ago

2.11.1

9 months ago

2.11.0

9 months ago

2.10.9

9 months ago

2.10.8

9 months ago

2.10.7

9 months ago

2.10.6

9 months ago

2.10.5

9 months ago

2.10.4

9 months ago

2.10.3

9 months ago

2.10.2

9 months ago

2.10.1

9 months ago

2.10.0

9 months ago

2.9.0

9 months ago

2.8.0

9 months ago

2.7.3

9 months ago

2.7.2

9 months ago

2.7.1

9 months ago

2.7.0

9 months ago

2.6.0

9 months ago

2.5.0

9 months ago

2.4.0

9 months ago

2.3.0

9 months ago

2.2.0

9 months ago

2.1.0

9 months ago

2.0.0

9 months ago

1.9.0

9 months ago

1.8.0

9 months ago

1.7.0

10 months ago

1.6.0

10 months ago

1.5.0

10 months ago

1.4.0

10 months ago

1.3.0

10 months ago

1.2.0

10 months ago

1.1.0

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago