@qore-id/react-native-qoreid-sdk 0.1.0-snapshot → 0.1.2-snapshot
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/android/src/main/java/com/qoreidsdk/QoreIdJSData.kt +1 -0
- package/android/src/main/java/com/qoreidsdk/QoreIdReactButtonFragment.kt +22 -6
- package/android/src/main/java/com/qoreidsdk/QoreIdReactButtonManager.kt +5 -4
- package/lib/commonjs/qoreIdButton.android.js +10 -4
- package/lib/commonjs/qoreIdButton.android.js.map +1 -1
- package/lib/module/qoreIdButton.android.js +10 -4
- package/lib/module/qoreIdButton.android.js.map +1 -1
- package/lib/typescript/qoreIdButton.android.d.ts.map +1 -1
- package/package.json +1 -4
- package/{react-native-qoreid-sdk.podspec → qore-id-react-native-qoreid-sdk.podspec} +1 -1
- package/src/qoreIdButton.android.tsx +8 -3
- package/src/types.d.ts +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ import com.qoreid.sdk.core.models.ApplicantData
|
|
|
17
17
|
|
|
18
18
|
class QoreIdReactButtonFragment : Fragment() {
|
|
19
19
|
private lateinit var qoredIdButton: QoreIDButton
|
|
20
|
-
var
|
|
20
|
+
var config: String = ""
|
|
21
21
|
var buttonPropsString: String = "";
|
|
22
22
|
private val gson = Gson()
|
|
23
23
|
|
|
@@ -25,25 +25,41 @@ class QoreIdReactButtonFragment : Fragment() {
|
|
|
25
25
|
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
|
|
26
26
|
): View {
|
|
27
27
|
super.onCreateView(inflater, container, savedInstanceState)
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
qoredIdButton = QoreIDButton(requireContext())
|
|
29
|
+
qoredIdButton.setText("Launch QoreID")
|
|
30
30
|
if (buttonPropsString != "") {
|
|
31
31
|
val buttonProps = gson.fromJson(buttonPropsString, StyleOptionsData::class.java)
|
|
32
32
|
qoredIdButton.setText(buttonProps.title)
|
|
33
33
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
37
36
|
return qoredIdButton // this qoreIdButton could be any view that you want to render
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
|
41
40
|
super.onViewCreated(view, savedInstanceState)
|
|
41
|
+
val configData = gson.fromJson(config, Config::class.java)
|
|
42
|
+
|
|
43
|
+
if (configData.flowId != 0L) {
|
|
44
|
+
qoredIdButton
|
|
45
|
+
.params(
|
|
46
|
+
QoreIDParams()
|
|
47
|
+
.clientId(configData.clientId)
|
|
48
|
+
.customerReference(configData.customerRef)
|
|
49
|
+
.ocrAcceptedDocuments(configData.acceptedDocuments)
|
|
50
|
+
.workflow(configData.flowId!!)
|
|
51
|
+
|
|
52
|
+
)
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
42
55
|
|
|
43
56
|
qoredIdButton
|
|
44
57
|
.params(
|
|
45
58
|
QoreIDParams()
|
|
46
|
-
.clientId(clientId)
|
|
59
|
+
.clientId(configData.clientId)
|
|
60
|
+
.customerReference(configData.customerRef)
|
|
61
|
+
.ocrAcceptedDocuments(configData.acceptedDocuments)
|
|
62
|
+
.collection(configData.productCode)
|
|
47
63
|
)
|
|
48
64
|
|
|
49
65
|
}
|
|
@@ -51,7 +67,7 @@ class QoreIdReactButtonFragment : Fragment() {
|
|
|
51
67
|
|
|
52
68
|
fun dataEventListener(jsonData: String) {
|
|
53
69
|
Log.i("QoredID Event", "listening")
|
|
54
|
-
Log.d("INITIALIze"
|
|
70
|
+
Log.d("INITIALIze", ::qoredIdButton.isInitialized.toString())
|
|
55
71
|
if (!::qoredIdButton.isInitialized) {
|
|
56
72
|
return
|
|
57
73
|
}
|
|
@@ -50,10 +50,10 @@ class QoreIdReactButtonManager(
|
|
|
50
50
|
when (commandId.toInt()) {
|
|
51
51
|
COMMAND_CREATE -> {
|
|
52
52
|
val reactNativeViewId = requireNotNull(args).getInt(0)
|
|
53
|
-
var
|
|
53
|
+
var config = requireNotNull(args).getString(1)
|
|
54
54
|
var btnString = args?.getString(2) ?: ""
|
|
55
55
|
|
|
56
|
-
createFragment(root, reactNativeViewId,
|
|
56
|
+
createFragment(root, reactNativeViewId, config, btnString)
|
|
57
57
|
}
|
|
58
58
|
COMMAND_DATA_CHANGE -> {
|
|
59
59
|
val data = requireNotNull(args).getString(0)
|
|
@@ -72,12 +72,12 @@ class QoreIdReactButtonManager(
|
|
|
72
72
|
/**
|
|
73
73
|
* Replace your React Native view with a custom fragment
|
|
74
74
|
*/
|
|
75
|
-
fun createFragment(root: FrameLayout, reactNativeViewId: Int,
|
|
75
|
+
fun createFragment(root: FrameLayout, reactNativeViewId: Int, config: String, btn: String?) {
|
|
76
76
|
val parentView = root.findViewById<ViewGroup>(reactNativeViewId)
|
|
77
77
|
setupLayout(parentView)
|
|
78
78
|
|
|
79
79
|
val mFragment = QoreIdReactButtonFragment.getInstance()
|
|
80
|
-
mFragment.
|
|
80
|
+
mFragment.config = config
|
|
81
81
|
|
|
82
82
|
if(btn != null) {
|
|
83
83
|
mFragment.buttonPropsString = btn
|
|
@@ -86,6 +86,7 @@ class QoreIdReactButtonManager(
|
|
|
86
86
|
activity.supportFragmentManager.beginTransaction()
|
|
87
87
|
.replace(reactNativeViewId, mFragment, reactNativeViewId.toString()).commit()
|
|
88
88
|
|
|
89
|
+
|
|
89
90
|
// Add an `OnGlobalLayoutListener` to the parent view to detect when the view is unmounted
|
|
90
91
|
parentView.viewTreeObserver.addOnGlobalLayoutListener(object :
|
|
91
92
|
ViewTreeObserver.OnGlobalLayoutListener {
|
|
@@ -31,7 +31,7 @@ function useQoreId(ref, options) {
|
|
|
31
31
|
const buttonStyles = JSON.stringify(options.buttonProps);
|
|
32
32
|
_reactNative.UIManager.dispatchViewManagerCommand((0, _reactNative.findNodeHandle)(ref.current), // we are calling the 'create' command
|
|
33
33
|
//@ts-ignore
|
|
34
|
-
_reactNative.UIManager === null || _reactNative.UIManager === void 0 ? void 0 : (_UIManager$QoreIdReac = _reactNative.UIManager.QoreIdReactButtonManager) === null || _UIManager$QoreIdReac === void 0 ? void 0 : (_UIManager$QoreIdReac2 = _UIManager$QoreIdReac.Commands) === null || _UIManager$QoreIdReac2 === void 0 ? void 0 : _UIManager$QoreIdReac2.create.toString(), [(0, _reactNative.findNodeHandle)(ref.current), options.
|
|
34
|
+
_reactNative.UIManager === null || _reactNative.UIManager === void 0 ? void 0 : (_UIManager$QoreIdReac = _reactNative.UIManager.QoreIdReactButtonManager) === null || _UIManager$QoreIdReac === void 0 ? void 0 : (_UIManager$QoreIdReac2 = _UIManager$QoreIdReac.Commands) === null || _UIManager$QoreIdReac2 === void 0 ? void 0 : _UIManager$QoreIdReac2.create.toString(), [(0, _reactNative.findNodeHandle)(ref.current), options.config, buttonStyles]);
|
|
35
35
|
}, []);
|
|
36
36
|
(0, _react.useEffect)(() => {
|
|
37
37
|
const eventEmitter = new _reactNative.NativeEventEmitter(_reactNative.NativeModules.QoreidSdk);
|
|
@@ -57,10 +57,16 @@ const onChangeData = (ref, data) => {
|
|
|
57
57
|
}, [stringified]);
|
|
58
58
|
};
|
|
59
59
|
const QoreIdButton = initialData => {
|
|
60
|
-
var _initialData$ocrAccep;
|
|
60
|
+
var _initialData$ocrAccep, _initialData$ocrAccep2;
|
|
61
61
|
const ref = (0, _react.useRef)(null);
|
|
62
62
|
useQoreId(ref, {
|
|
63
|
-
|
|
63
|
+
config: JSON.stringify({
|
|
64
|
+
flowId: initialData.flowId || 0,
|
|
65
|
+
customerRef: initialData.customerReference,
|
|
66
|
+
productCode: initialData.productCode,
|
|
67
|
+
clientId: initialData.clientId,
|
|
68
|
+
acceptedDocuments: (_initialData$ocrAccep = initialData.ocrAcceptedDocuments) === null || _initialData$ocrAccep === void 0 ? void 0 : _initialData$ocrAccep.split(',')
|
|
69
|
+
}),
|
|
64
70
|
onError(data) {
|
|
65
71
|
initialData.onQoreIDSdkError && initialData.onQoreIDSdkError(data);
|
|
66
72
|
},
|
|
@@ -84,7 +90,7 @@ const QoreIdButton = initialData => {
|
|
|
84
90
|
addressData: {
|
|
85
91
|
...initialData.addressData
|
|
86
92
|
},
|
|
87
|
-
acceptedDocuments: (_initialData$
|
|
93
|
+
acceptedDocuments: (_initialData$ocrAccep2 = initialData.ocrAcceptedDocuments) === null || _initialData$ocrAccep2 === void 0 ? void 0 : _initialData$ocrAccep2.split(','),
|
|
88
94
|
identityData: {
|
|
89
95
|
...initialData.identityData
|
|
90
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","QoreIdReactButtonManager","requireNativeComponent","Button","forwardRef","_props","ref","createElement","Fragment","View","style","position","margin","height","borderWidth","useQoreId","options","onSubmitted","useCallback","data","onError","useEffect","_UIManager$QoreIdReac","_UIManager$QoreIdReac2","buttonStyles","JSON","stringify","buttonProps","UIManager","dispatchViewManagerCommand","findNodeHandle","current","Commands","create","toString","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","QoreIdReactButtonManager","requireNativeComponent","Button","forwardRef","_props","ref","createElement","Fragment","View","style","position","margin","height","borderWidth","useQoreId","options","onSubmitted","useCallback","data","onError","useEffect","_UIManager$QoreIdReac","_UIManager$QoreIdReac2","buttonStyles","JSON","stringify","buttonProps","UIManager","dispatchViewManagerCommand","findNodeHandle","current","Commands","create","toString","config","eventEmitter","NativeEventEmitter","NativeModules","QoreidSdk","eventListener","addListener","event","code","remove","onChangeData","stringified","_UIManager$QoreIdReac3","_UIManager$QoreIdReac4","update","QoreIdButton","initialData","_initialData$ocrAccep","_initialData$ocrAccep2","useRef","flowId","customerRef","customerReference","productCode","clientId","acceptedDocuments","ocrAcceptedDocuments","split","onQoreIDSdkError","onQoreIDSdkSubmitted","title","applicantData","addressData","identityData","exports"],"sourceRoot":"../../src","sources":["qoreIdButton.android.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,YAAA,GAAAD,OAAA;AAOsB,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GA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CC,WAAW,EAAEP,WAAW,CAACO,WAAY;MACrCC,QAAQ,EAAER,WAAW,CAACQ;IACxB,CAAC;IACDO,aAAa,EAAE;MACb,GAAGf,WAAW,CAACe;IACjB,CAAC;IACDC,WAAW,EAAE;MACX,GAAGhB,WAAW,CAACgB;IACjB,CAAC;IACDP,iBAAiB,GAAAP,sBAAA,GAAEF,WAAW,CAACU,oBAAoB,cAAAR,sBAAA,uBAAhCA,sBAAA,CAAkCS,KAAK,CAAC,GAAG,CAAC;IAC/DM,YAAY,EAAE;MAAE,GAAGjB,WAAW,CAACiB;IAAa;EAC9C,CAAC,CAAC;EACF,oBAAO7F,MAAA,CAAAW,OAAA,CAAAqB,aAAA,CAACJ,MAAM;IAACG,GAAG,EAAEA;EAAI,EAAG;AAC7B,CAAC;AAAC+D,OAAA,CAAAnB,YAAA,GAAAA,YAAA"}
|
|
@@ -23,7 +23,7 @@ function useQoreId(ref, options) {
|
|
|
23
23
|
const buttonStyles = JSON.stringify(options.buttonProps);
|
|
24
24
|
UIManager.dispatchViewManagerCommand(findNodeHandle(ref.current), // we are calling the 'create' command
|
|
25
25
|
//@ts-ignore
|
|
26
|
-
UIManager === null || UIManager === void 0 ? void 0 : (_UIManager$QoreIdReac = UIManager.QoreIdReactButtonManager) === null || _UIManager$QoreIdReac === void 0 ? void 0 : (_UIManager$QoreIdReac2 = _UIManager$QoreIdReac.Commands) === null || _UIManager$QoreIdReac2 === void 0 ? void 0 : _UIManager$QoreIdReac2.create.toString(), [findNodeHandle(ref.current), options.
|
|
26
|
+
UIManager === null || UIManager === void 0 ? void 0 : (_UIManager$QoreIdReac = UIManager.QoreIdReactButtonManager) === null || _UIManager$QoreIdReac === void 0 ? void 0 : (_UIManager$QoreIdReac2 = _UIManager$QoreIdReac.Commands) === null || _UIManager$QoreIdReac2 === void 0 ? void 0 : _UIManager$QoreIdReac2.create.toString(), [findNodeHandle(ref.current), options.config, buttonStyles]);
|
|
27
27
|
}, []);
|
|
28
28
|
useEffect(() => {
|
|
29
29
|
const eventEmitter = new NativeEventEmitter(NativeModules.QoreidSdk);
|
|
@@ -49,10 +49,16 @@ const onChangeData = (ref, data) => {
|
|
|
49
49
|
}, [stringified]);
|
|
50
50
|
};
|
|
51
51
|
export const QoreIdButton = initialData => {
|
|
52
|
-
var _initialData$ocrAccep;
|
|
52
|
+
var _initialData$ocrAccep, _initialData$ocrAccep2;
|
|
53
53
|
const ref = useRef(null);
|
|
54
54
|
useQoreId(ref, {
|
|
55
|
-
|
|
55
|
+
config: JSON.stringify({
|
|
56
|
+
flowId: initialData.flowId || 0,
|
|
57
|
+
customerRef: initialData.customerReference,
|
|
58
|
+
productCode: initialData.productCode,
|
|
59
|
+
clientId: initialData.clientId,
|
|
60
|
+
acceptedDocuments: (_initialData$ocrAccep = initialData.ocrAcceptedDocuments) === null || _initialData$ocrAccep === void 0 ? void 0 : _initialData$ocrAccep.split(',')
|
|
61
|
+
}),
|
|
56
62
|
onError(data) {
|
|
57
63
|
initialData.onQoreIDSdkError && initialData.onQoreIDSdkError(data);
|
|
58
64
|
},
|
|
@@ -76,7 +82,7 @@ export const QoreIdButton = initialData => {
|
|
|
76
82
|
addressData: {
|
|
77
83
|
...initialData.addressData
|
|
78
84
|
},
|
|
79
|
-
acceptedDocuments: (_initialData$
|
|
85
|
+
acceptedDocuments: (_initialData$ocrAccep2 = initialData.ocrAcceptedDocuments) === null || _initialData$ocrAccep2 === void 0 ? void 0 : _initialData$ocrAccep2.split(','),
|
|
80
86
|
identityData: {
|
|
81
87
|
...initialData.identityData
|
|
82
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useCallback","useEffect","useRef","UIManager","findNodeHandle","requireNativeComponent","View","NativeEventEmitter","NativeModules","QoreIdReactButtonManager","Button","_props","ref","createElement","Fragment","style","position","margin","height","borderWidth","useQoreId","options","onSubmitted","data","onError","_UIManager$QoreIdReac","_UIManager$QoreIdReac2","buttonStyles","JSON","stringify","buttonProps","dispatchViewManagerCommand","current","Commands","create","toString","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useCallback","useEffect","useRef","UIManager","findNodeHandle","requireNativeComponent","View","NativeEventEmitter","NativeModules","QoreIdReactButtonManager","Button","_props","ref","createElement","Fragment","style","position","margin","height","borderWidth","useQoreId","options","onSubmitted","data","onError","_UIManager$QoreIdReac","_UIManager$QoreIdReac2","buttonStyles","JSON","stringify","buttonProps","dispatchViewManagerCommand","current","Commands","create","toString","config","eventEmitter","QoreidSdk","eventListener","addListener","event","code","remove","onChangeData","stringified","_UIManager$QoreIdReac3","_UIManager$QoreIdReac4","update","QoreIdButton","initialData","_initialData$ocrAccep","_initialData$ocrAccep2","flowId","customerRef","customerReference","productCode","clientId","acceptedDocuments","ocrAcceptedDocuments","split","onQoreIDSdkError","onQoreIDSdkSubmitted","title","applicantData","addressData","identityData"],"sourceRoot":"../../src","sources":["qoreIdButton.android.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAEVC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,MAAM,QACD,OAAO;AACd,SACEC,SAAS,EACTC,cAAc,EACdC,sBAAsB,EACtBC,IAAI,EACJC,kBAAkB,EAClBC,aAAa,QACR,cAAc;AAGrB,MAAMC,wBAAwB,GAAGJ,sBAAsB,CAEpD,0BAA0B,CAAC;AAE9B,MAAMK,MAAM,gBAAGX,UAAU,CAKvB,CAACY,MAAM,EAAEC,GAAG,KAAK;EACjB,oBACEd,KAAA,CAAAe,aAAA,CAAAf,KAAA,CAAAgB,QAAA,qBACEhB,KAAA,CAAAe,aAAA,CAACP,IAAI;IACHS,KAAK,EAAE;MACLC,QAAQ,EAAE,UAAU;MACpBC,MAAM,EAAE,MAAM;MACdC,MAAM,EAAE,EAAE;MACVC,WAAW,EAAE;IACf;EAAE,gBAEFrB,KAAA,CAAAe,aAAA,CAACJ;EACC;EAAA;IACAG,GAAG,EAAEA;EAAI,EACT,CACG,CACN;AAEP,CAAC,CAAC;AAEF,SAASQ,SAASA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CAACW,gBAAgB,IAAIX,WAAW,CAACW,gBAAgB,CAACtC,IAAI,CAAC;IACpE,CAAC;IACDD,WAAWA,CAACC,IAAI,EAAE;MAChB2B,WAAW,CAACY,oBAAoB,IAC9BZ,WAAW,CAACY,oBAAoB,CAACvC,IAAI,CAAC;IAC1C,CAAC;IACDO,WAAW,EAAE;MACXiC,KAAK,EAAEb,WAAW,CAACa;IACrB;EACF,CAAC,CAAC;EAEFnB,YAAY,CAAChC,GAAG,EAAE;IAChBwB,MAAM,EAAE;MACNiB,MAAM,EAAEH,WAAW,CAACG,MAAM,IAAI,CAAC;MAC/BC,WAAW,EAAEJ,WAAW,CAACK,iBAAiB;MAC1CC,WAAW,EAAEN,WAAW,CAACM,WAAY;MACrCC,QAAQ,EAAEP,WAAW,CAACO;IACxB,CAAC;IACDO,aAAa,EAAE;MACb,GAAGd,WAAW,CAACc;IACjB,CAAC;IACDC,WAAW,EAAE;MACX,GAAGf,WAAW,CAACe;IACjB,CAAC;IACDP,iBAAiB,GAAAN,sBAAA,GAAEF,WAAW,CAACS,oBAAoB,cAAAP,sBAAA,uBAAhCA,sBAAA,CAAkCQ,KAAK,CAAC,GAAG,CAAC;IAC/DM,YAAY,EAAE;MAAE,GAAGhB,WAAW,CAACgB;IAAa;EAC9C,CAAC,CAAC;EACF,oBAAOpE,KAAA,CAAAe,aAAA,CAACH,MAAM;IAACE,GAAG,EAAEA;EAAI,EAAG;AAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qoreIdButton.android.d.ts","sourceRoot":"","sources":["../../src/qoreIdButton.android.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAmC,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"qoreIdButton.android.d.ts","sourceRoot":"","sources":["../../src/qoreIdButton.android.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAmC,aAAa,EAAE,MAAM,SAAS,CAAC;AAqF9E,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAwChD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qore-id/react-native-qoreid-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2-snapshot",
|
|
4
4
|
"description": "QoreId React Native SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -158,8 +158,5 @@
|
|
|
158
158
|
}
|
|
159
159
|
]
|
|
160
160
|
]
|
|
161
|
-
},
|
|
162
|
-
"dependencies": {
|
|
163
|
-
"react-native-webview": "^12.0.2"
|
|
164
161
|
}
|
|
165
162
|
}
|
|
@@ -4,7 +4,7 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
|
4
4
|
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
5
5
|
|
|
6
6
|
Pod::Spec.new do |s|
|
|
7
|
-
s.name = "
|
|
7
|
+
s.name = "qore-id-react-native-qoreid-sdk"
|
|
8
8
|
s.version = package["version"]
|
|
9
9
|
s.summary = package["description"]
|
|
10
10
|
s.homepage = package["homepage"]
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
} from 'react-native';
|
|
16
16
|
import type { DataType, OnResultType, Options, IQoreIdButton } from './types';
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
const QoreIdReactButtonManager = requireNativeComponent<{
|
|
20
19
|
style?: { width?: number; height?: number };
|
|
21
20
|
}>('QoreIdReactButtonManager');
|
|
@@ -62,7 +61,7 @@ function useQoreId(ref: RefObject<any>, options: Options) {
|
|
|
62
61
|
// we are calling the 'create' command
|
|
63
62
|
//@ts-ignore
|
|
64
63
|
UIManager?.QoreIdReactButtonManager?.Commands?.create.toString(),
|
|
65
|
-
[findNodeHandle(ref.current), options.
|
|
64
|
+
[findNodeHandle(ref.current), options.config, buttonStyles]
|
|
66
65
|
);
|
|
67
66
|
}, []);
|
|
68
67
|
|
|
@@ -103,7 +102,13 @@ export const QoreIdButton: React.FC<IQoreIdButton> = (initialData) => {
|
|
|
103
102
|
const ref = useRef(null);
|
|
104
103
|
|
|
105
104
|
useQoreId(ref, {
|
|
106
|
-
|
|
105
|
+
config: JSON.stringify({
|
|
106
|
+
flowId: initialData.flowId || 0,
|
|
107
|
+
customerRef: initialData.customerReference,
|
|
108
|
+
productCode: initialData.productCode!,
|
|
109
|
+
clientId: initialData.clientId,
|
|
110
|
+
acceptedDocuments: initialData.ocrAcceptedDocuments?.split(','),
|
|
111
|
+
}),
|
|
107
112
|
onError(data) {
|
|
108
113
|
initialData.onQoreIDSdkError && initialData.onQoreIDSdkError(data);
|
|
109
114
|
},
|
package/src/types.d.ts
CHANGED