3.0.2 • Published 8 months ago

@bnnsoftvn/mobile-sic-sdk v3.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 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

8 months ago

3.0.1

8 months ago

3.0.0

8 months ago

2.13.6

8 months ago

2.13.5

8 months ago

2.13.4

8 months ago

2.13.2

8 months ago

2.13.1

8 months ago

2.13.0

8 months ago

2.12.5

8 months ago

2.12.4

8 months ago

2.12.3

8 months ago

2.12.2

8 months ago

2.12.1

8 months ago

2.12.0

8 months ago

2.11.9

8 months ago

2.11.8

8 months ago

2.11.7

8 months ago

2.11.6

8 months ago

2.11.5

8 months ago

2.9.1

8 months ago

2.11.4

8 months ago

2.11.3

8 months ago

2.11.2

8 months ago

2.11.1

8 months ago

2.11.0

8 months ago

2.10.9

8 months ago

2.10.8

8 months ago

2.10.7

8 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

9 months ago

1.6.0

9 months ago

1.5.0

9 months ago

1.4.0

9 months ago

1.3.0

9 months ago

1.2.0

9 months ago

1.1.0

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago