UNPKG

react-native-bynn-sdk

Version:

Bynn Mobile SDK for React Native - Identity verification and KYC

1 lines 3.11 kB
'use strict';const _0x30e1ce=_0x48cc;(function(_0x3e41c0,_0x5e2116){const _0x452a4f=_0x48cc,_0x4b4519=_0x3e41c0();while(!![]){try{const _0x202427=parseInt(_0x452a4f(0x119))/0x1+-parseInt(_0x452a4f(0x124))/0x2*(parseInt(_0x452a4f(0x120))/0x3)+parseInt(_0x452a4f(0x118))/0x4+parseInt(_0x452a4f(0x114))/0x5*(-parseInt(_0x452a4f(0x113))/0x6)+-parseInt(_0x452a4f(0x117))/0x7+-parseInt(_0x452a4f(0x121))/0x8+-parseInt(_0x452a4f(0x127))/0x9*(-parseInt(_0x452a4f(0x11a))/0xa);if(_0x202427===_0x5e2116)break;else _0x4b4519['push'](_0x4b4519['shift']());}catch(_0x51f9a0){_0x4b4519['push'](_0x4b4519['shift']());}}}(_0x2ad3,0xc3444));Object[_0x30e1ce(0x12c)](exports,'__esModule',{'value':!![]}),exports[_0x30e1ce(0x11c)]=void 0x0;var _react=require('react'),_reactNative=require(_0x30e1ce(0x111));function _0x48cc(_0x9befc3,_0x3dd5ef){const _0x2ad34e=_0x2ad3();return _0x48cc=function(_0x48cc9d,_0x1efb22){_0x48cc9d=_0x48cc9d-0x10f;let _0x27a64a=_0x2ad34e[_0x48cc9d];return _0x27a64a;},_0x48cc(_0x9befc3,_0x3dd5ef);}const useWebSocket=({url:_0x330ebe,sessionId:_0x57082e,onPreflight:_0x2def10})=>{const _0x16e5c2=(0x0,_react['useRef'])(null);(0x0,_react['useEffect'])(()=>{const _0x2e1a0f=_0x48cc;if(!_0x330ebe||!_0x57082e)return;const _0x155b29=new WebSocket(_0x330ebe);return _0x16e5c2['current']=_0x155b29,_0x155b29['onopen']=()=>{const _0x2b272a=_0x48cc;console['log']('WebSocket\x20connected'),_0x155b29[_0x2b272a(0x112)](JSON[_0x2b272a(0x129)]({'command':'subscribe','identifier':JSON[_0x2b272a(0x129)]({'channel':_0x2b272a(0x126)})}));},_0x155b29['onmessage']=_0x2bdff9=>{const _0x4722e6=_0x48cc;try{const _0x5946dd=JSON[_0x4722e6(0x11e)](_0x2bdff9[_0x4722e6(0x116)]);_0x5946dd?.['message']&&(console[_0x4722e6(0x12a)]('Received\x20preflight:',_0x5946dd[_0x4722e6(0x11d)]),_0x5946dd['message']['entity_id_state']=='front_received_but_needs_resubmission'&&_reactNative[_0x4722e6(0x110)]['alert'](_0x4722e6(0x115)),_0x5946dd['message']['entity_id_state']==_0x4722e6(0x125)&&_reactNative[_0x4722e6(0x110)][_0x4722e6(0x10f)](_0x4722e6(0x122)),_0x2def10(_0x5946dd[_0x4722e6(0x11d)]));}catch(_0x5ae92f){console[_0x4722e6(0x11f)]('Failed\x20to\x20parse\x20WS\x20message',_0x2bdff9['data']);}},_0x155b29[_0x2e1a0f(0x123)]=_0xe3da4e=>{const _0x1f458f=_0x2e1a0f;console['error'](_0x1f458f(0x11b),_0xe3da4e);},_0x155b29[_0x2e1a0f(0x128)]=()=>{console['log']('WebSocket\x20closed');},()=>{const _0x305b06=_0x2e1a0f;_0x155b29[_0x305b06(0x12b)]();};},[_0x330ebe,_0x57082e]);};exports[_0x30e1ce(0x11c)]=useWebSocket;function _0x2ad3(){const _0x80443f=['warn','6DItXdg','2727376WUGIiu','Please\x20upload\x20the\x20back\x20of\x20your\x20ID\x20again','onerror','1596268oKYvuh','front_received_and_back_received_but_back_needs_resubmission','BynnKycChannel','20876967IWRhmS','onclose','stringify','log','close','defineProperty','alert','Alert','react-native','send','2190dNbsMx','2150oaVUoo','Please\x20upload\x20the\x20front\x20of\x20your\x20ID\x20again','data','8409849wWcIUS','1254112pQbVOW','1462168XLMajz','10JrmfTl','WebSocket\x20error:','useWebSocket','message','parse'];_0x2ad3=function(){return _0x80443f;};return _0x2ad3();}