SumSubstance / react-native-mobilesdk-module

3 stars 5 forks source link

withPreferredDocumentDefinitions not working for android, working for ios #13

Open kneeraj1996 opened 6 months ago

kneeraj1996 commented 6 months ago

Expected behaviour:- According to country code by default specific country should be already selected from country picker when modal gets opened, workking fine on ios not for android.

This function is only working for ios not for android

.withPreferredDocumentDefinitions({ "IDENTITY": { "country":countryCode }

})

this is full code const launchSNSMobileSDK = (userId: string, cameFrom: string, countryCode: string) => { let snsMobileSDK = SNSMobileSDK.init(sumSubDummyToken, () => { // this is a token expiration handler, will be called if the provided token is invalid or got expired

return common.axiosGenericInstance
  .get(`${BASEURL.MAIN_API_URL}${endPoints.sumsubAccessToken}`, {
    params: {userId: userId},
  })
  .then(resp => {
    //return a fresh token from here
    return resp?.data?.data?.token;
  });

}) .withPreferredDocumentDefinitions({ "IDENTITY": { "country":countryCode }

}) .withHandlers({ // Optional callbacks you can use to get notified of the corresponding events onStatusChanged: event => {}, onLog: event => {}, }) .withDebug(true) .withLocale('en') // Optional, for cases when you need to override the system locale .build();

snsMobileSDK .launch() .then(result => { const cb = () => { switchLoader(store.dispatch, false); navigate(screenNames.HOME_SCREEN) }; switchLoader(store.dispatch, true); store.dispatch(getUserStatistics()); store.dispatch(getProfileData(cb, cb)); }) .catch(err => { console.log('sum sub error', err); }); };