I’m trying to change fonts in the Sumsub SDK,
I did everything according to the documentation on IOS all styles work and including fonts, on Android also everything works except fonts
const launchSNSMobileSDK = () => {
let snsMobileSDK = SNSMobileSDK.init(data?.sumsubSdkToken, () => {
// this is a token expiration handler, will be called if the provided token is invalid or got expired
return trigger();
})
.withTheme(sumsubStyles)
.withHandlers({
// Optional callbacks you can use to get notified of the corresponding events
onStatusChanged: (event: any) => {
console.log(
'onStatusChanged: [' +
event.prevStatus +
'] => [' +
event.newStatus +
']',
);
if (event.newStatus === 'Pending') {
setTimeout(() => {
dispatch(idVerificationActions.setOnfidoDone(true));
setLoading(false);
onOnfidoDone();
trackEvent(EventKey.IDCHECK_SUBMITTED, addPrefixToKeys({}));
}, 1000);
}
},
onLog: (event: any) => {
console.log('onLog: [Idensic] ' + event.message);
},
onActionResult: (result: any) => {
console.log('onActionResult: ' + JSON.stringify(result));
// you must return a `Promise` that in turn should be resolved with
// either `cancel` to force the user interface to close, or `continue` to proceed as usual
return new Promise((resolve) => {
resolve('continue');
});
},
})
.withDebug(true)
.withLocale('en') // Optional, for cases when you need to override the system locale
.withPreferredDocumentDefinitions({
IDENTITY: {
idDocType: identificationDocument,
country:
jurisdiction === 'GB'
? OnfidoCountryCode.GBR
: OnfidoCountryCode.USA,
},
})
.build();
snsMobileSDK
.launch()
.then((result: any) => {
// dispatch(idVerificationActions.setOnfidoDone(true));
// setLoading(false);
// onOnfidoDone();
console.log('SumSub SDK State: ' + JSON.stringify(result));
trackEvent(EventKey.IDCHECK_COMPLETED, addPrefixToKeys({}));
})
.catch((err: { code: string; message: string }) => {
// setLoading(false);
// if (err.code !== 'userExit') {
// dispatch(
// commonActions.setNotification({
// type: 'error',
// text: t('common.formMessages.globalError'),
// }),
// );
// Logger.error('Error with Onfido SDK', {
// type: Logger.Type.interface,
// payload: {
// res: err.message,
// },
// });
// }
console.log('SumSub SDK Error: ' + JSON.stringify(err));
});
};
This is my sumsubStyles.json file with styles and fonts
{
"universal": {
"fonts": {
"assets": [
{
"name": "Raleway-Bold",
"file": "assets/fonts/Raleway-Bold.ttf"
},
{
"name": "Raleway-Medium",
"file": "assets/fonts/Raleway-Medium.ttf"
}
],
"headline1": {
"name": "Raleway-Bold",
"size": 26
},
"headline2": {
"name": "Raleway-Bold",
"size": 20
},
"subtitle1": {
"name": "Raleway-Bold"
},
"subtitle2": {
"name": "Raleway-Medium"
},
"caption": {
"name": "Raleway-Bold",
"size": 13
},
"body": {
"name": "Raleway-Medium",
"size": 13
}
},
"colors": {
"navigationBarItem": "#000000",
"contentStrong": "#000000",
"contentWeak": "#000000",
"contentNeutral": "#000000",
"contentLink": "#944BFE",
"cameraBackground": "#000000",
"bottomSheetHandle": "#000000",
"iconRotate": "#000000",
"primaryButtonBackground": "#000000",
"primaryButtonBackgroundDisabled": "#000000",
"primaryButtonBackgroundHighlighted": "#474747",
"secondaryButtonContent": "#000000",
"secondaryButtonContentDisabled": "#000000",
"secondaryButtonContentHighlighted": "#000000",
"secondaryButtonBackgroundHighlighted": "#e6e6e6",
"contentInfo": "#18B494",
"backgroundCritical": "#FFFFFF",
"backgroundCommon": "#FFFFFF",
"cardBorderedBackground": "#F6F7F9",
"backgroundNeutral": "F6F7F9",
"verificationStepCardStyle": "plain",
"cardPlainBackground": "#F6F7F9",
"fieldBackground": "#F6F7F9",
"fieldContent": "#333C4D",
"fieldPlaceholder": "#94A0B8",
"bottomSheetBackground": "#FFFFFF",
"primaryButtonContentDisabled": "#FFFFFF"
}
},
"ios": {
"metrics": {
"commonStatusBarStyle": "default"
}
}
}
This is the error I encounter when opening Sumsub on the emulator, and accordingly the fonts are not applied