박상우
박상우
RN android 에서만 겪는 초기화 이슈 문의드립니다. 비슷한 사례가 있었다면 어떻게 안내해주셨는지 궁금합니다.
https://github.com/tosspayments/tosspayments-sample-v1/blob/main/payment-widget/react-native/App.tsx 위 코드 App.tsx 참고해서 현재 ios 는 문제 없이 잘 작동합니다. android에서만 {paymentWidgetControl && ( <PaymentMethodWidget {paymentWidgetControl && ( <PaymentMethodWidget selector="payment-methods" onLoadEnd={async () => { console.debug('📦 [PaymentMethodWidget] onLoadEnd 시작'); try { // 여기서 코드가 멈춥니다~! const control = await paymentWidgetControl.renderPaymentMethods( 'payment-methods', { value: TRAINER_MATCHING_PRICE, currency: 'KRW', country: 'KR' }, { variantKey: 'DEFAULT' } ); // 여기까지 안 오는 문제가 발생합니다. // async await 는 시점 디버깅을 위해 추가했습니다. then 사용해도 동일하게 android 에서만 위 renderPaymentMethods 메소드가 동작하지 않습니다. 리소스 경쟁이 발생하는 건지, 교착상태에 빠진 걸로 보입니다. console.debug('✅ renderPaymentMethods 완료:', control); setPaymentMethodWidgetControl(control); } catch (error: any) { console.error('❌ renderPaymentMethods 오류:', JSON.stringify(error)); Alert.alert('결제 위젯 초기화 오류', error.message || JSON.stringify(error)); } }} /> )} 코드 일 부분인데 주석으로 상세하게 이슈를 남겼습니다. 감사합니다.
86 replies
RN Expo 에서
https://docs.tosspayments.com/sdk/widget-rn 참고해서 그대로 따라갔습니다만 (예제 코드 그대로) agreementWidgetControl 과 paymentWidgetControl 이 계속 초기화되지 않는 이슈가 있습니다. PaymentWidgetProvider 태그에도 clientKey, customerKey 전부 설정되었구요..! 도움 요청드립니다. 정확하게 초기화 하는 방식이 어떻게 되는지 궁금합니다. 추가로 PaymentWidgetProvider 의 바로 자식요소만이 작동하는걸까요? 테스트 해봤는데 중간에 View 나 다른 element가 껴도 안 되는 건 동일했습니다.
25 replies
react native
No description
19 replies