react-native-bynn-sdk
Version:
Bynn Mobile SDK for React Native - Identity verification and KYC
1 lines • 2.71 kB
JavaScript
(function(_0x173046,_0x54c098){const _0xf30c58=_0x7e23,_0x2b106a=_0x173046();while(!![]){try{const _0x273da9=parseInt(_0xf30c58(0xe7))/0x1+-parseInt(_0xf30c58(0xe9))/0x2+parseInt(_0xf30c58(0xec))/0x3+parseInt(_0xf30c58(0xe6))/0x4+parseInt(_0xf30c58(0xf2))/0x5+parseInt(_0xf30c58(0xe4))/0x6*(-parseInt(_0xf30c58(0xe1))/0x7)+parseInt(_0xf30c58(0xf4))/0x8;if(_0x273da9===_0x54c098)break;else _0x2b106a['push'](_0x2b106a['shift']());}catch(_0x3bab3b){_0x2b106a['push'](_0x2b106a['shift']());}}}(_0x3974,0x49497));function _0x7e23(_0x38d65a,_0x40464c){const _0x39746=_0x3974();return _0x7e23=function(_0x7e2321,_0x2e4ff0){_0x7e2321=_0x7e2321-0xdf;let _0x2b2f0c=_0x39746[_0x7e2321];return _0x2b2f0c;},_0x7e23(_0x38d65a,_0x40464c);}import{useEffect,useRef}from'react';import{Alert}from'react-native';function _0x3974(){const _0x35865c=['2862306UZpWqC','onopen','5004udphBc','170310FCpmuk','onerror','854550PAtIaD','log','close','959460OeMnZc','WebSocket\x20closed','WebSocket\x20error:','BynnKycChannel','Failed\x20to\x20parse\x20WS\x20message','stringify','863230RbquHd','data','4323856LhUqDD','message','current','onclose','7UvACNb','error','parse'];_0x3974=function(){return _0x35865c;};return _0x3974();}export const useWebSocket=({url:_0x27ec18,sessionId:_0xb96339,onPreflight:_0xb8c3fe})=>{const _0x5e11fc=useRef(null);useEffect(()=>{const _0x71d3f2=_0x7e23;if(!_0x27ec18||!_0xb96339)return;const _0x5d985c=new WebSocket(_0x27ec18);return _0x5e11fc[_0x71d3f2(0xdf)]=_0x5d985c,_0x5d985c[_0x71d3f2(0xe5)]=()=>{const _0x15b056=_0x71d3f2;console['log']('WebSocket\x20connected'),_0x5d985c['send'](JSON['stringify']({'command':'subscribe','identifier':JSON[_0x15b056(0xf1)]({'channel':_0x15b056(0xef)})}));},_0x5d985c['onmessage']=_0x1052f7=>{const _0x522152=_0x71d3f2;try{const _0x498f99=JSON[_0x522152(0xe3)](_0x1052f7['data']);_0x498f99?.['message']&&(console[_0x522152(0xea)]('Received\x20preflight:',_0x498f99[_0x522152(0xf5)]),_0x498f99[_0x522152(0xf5)]['entity_id_state']=='front_received_but_needs_resubmission'&&Alert['alert']('Please\x20upload\x20the\x20front\x20of\x20your\x20ID\x20again'),_0x498f99[_0x522152(0xf5)]['entity_id_state']=='front_received_and_back_received_but_back_needs_resubmission'&&Alert['alert']('Please\x20upload\x20the\x20back\x20of\x20your\x20ID\x20again'),_0xb8c3fe(_0x498f99[_0x522152(0xf5)]));}catch(_0xb16693){console['warn'](_0x522152(0xf0),_0x1052f7[_0x522152(0xf3)]);}},_0x5d985c[_0x71d3f2(0xe8)]=_0x1752b1=>{const _0x29a14d=_0x71d3f2;console[_0x29a14d(0xe2)](_0x29a14d(0xee),_0x1752b1);},_0x5d985c[_0x71d3f2(0xe0)]=()=>{const _0x48716c=_0x71d3f2;console['log'](_0x48716c(0xed));},()=>{const _0x2ea0e2=_0x71d3f2;_0x5d985c[_0x2ea0e2(0xeb)]();};},[_0x27ec18,_0xb96339]);};