Я работаю над реализацией Sumsub SDK и получаю ошибку с классом SNSErrorHandler. Предлагается определить SNSAppActivity в файле Android Manifest.xml.
private void launchSdk(String accessToken, TokenExpirationHandler tokenUpdater) {//accessToken is coming from server (end pole) side.
List modules = Arrays.asList(new SNSProoface());
Context applicationContext = context.getApplicationContext();
SNSErrorHandler errorHandler = e -> {//Here I am getting error, It's saying to define SNSAppActivity in your Manifest.xml file
Timber.d("The SDK throws an exception. Exception: %s", e);
if (e instanceof SNSException.Api) {
Timber.d("Api exception. %s", ((SNSException.Api) e).getDescription());
} else if (e instanceof SNSException.Network) {
Timber.d(e, "Network exception.");
} else if (e instanceof SNSException.Unknown) {
Timber.d(e, "Unknown exception.");
}
Toast.makeText(applicationContext, "The SDK throws an exception. Exception: " + e, Toast.LENGTH_SHORT).show();
};
SNSStateChangedHandler stateChangedHandler = (previousState, currentState) -> {
Timber.d("The SDK state was changed: " + previousState + " -> " + currentState);
if (currentState instanceof SNSSDKState.Ready) {
Timber.d("SDK is ready");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.Failed.Unauthorized) {
Timber.e(((SNSSDKState.Failed.Unauthorized) currentState).getException(), "Invalid token or a token can't be refreshed by the SDK. Please, check your token expiration handler");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.Failed.Unknown) {
Timber.e(((SNSSDKState.Failed.Unknown) currentState).getException(), "Unknown error");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.Initial) {
Timber.d("No verification steps are passed yet");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.Incomplete) {
Timber.d("Some but not all verification steps are passed over");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.Pending) {
Timber.d("Verification is in pending state");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.FinallyRejected) {
Timber.d("Applicant has been finally rejected");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.TemporarilyDeclined) {
Timber.d("Applicant has been declined temporarily");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.Approved) {
Timber.d("Applicant has been approved");
parseStatus(currentState);
}
if (currentState instanceof SNSSDKState.ActionCompleted) {
SNSSDKState.ActionCompleted actionState = (SNSSDKState.ActionCompleted) currentState;
String actionId = actionState.getActionId();
FlowActionType type = actionState.getType();
String answer = actionState.getAnswer();
Map payload = actionState.getPayload();
}
};
SNSCompleteHandler completeHandler = (result, state) -> {
Timber.d("The SDK is finished. Result: " + result + " , State: " + state);
Toast.makeText(applicationContext, "The SDK is finished. Result: " + result + ", State: " + state, Toast.LENGTH_SHORT).show();
if (result instanceof SNSCompletionResult.SuccessTermination) {
Timber.d(result.toString());
} else if (result instanceof SNSCompletionResult.AbnormalTermination) {
Timber.d(((SNSCompletionResult.AbnormalTermination) result).getException());
}
};
SNSActionResultHandler actionResultHandler = (actionId, actionType, answer, allowContinuing) -> {
Timber.d("Action Result: actionId: " + actionId + ", answer: " + answer);
return SNSActionResult.Continue;
};
SNSEventHandler eventHandler = snsEvent -> {
if (snsEvent instanceof SNSEvent.SNSEventStepInitiated) {
Timber.d("onEvent: step initiated");
} else if (snsEvent instanceof SNSEvent.SNSEventStepCompleted) {
Timber.d("onEvent: step completed");
}
};
SNSSupportItem supportItem = new SNSSupportItem(
R.string.sns_support_title,
R.string.sns_support_subtitle,
SNSSupportItem.Type.Email, "support@company.com", null,
SNSIconHandler.SNSCommonIcons.MAIL.getImageName(), null);
try {
SNSMobileSDK.SDK snsSdk = new SNSMobileSDK.Builder(context)
.withBaseUrl(apiUrl)
.withAccessToken(accessToken, tokenUpdater)
.withDebug(true)
.withModules(modules)
.withCompleteHandler(completeHandler)
.withErrorHandler(errorHandler)
.withStateChangedHandler(stateChangedHandler)
.withActionResultHandler(actionResultHandler)
.withEventHandler(eventHandler)
.withSupportItems(Collections.singletonList(supportItem))
.withConf(new SNSInitConfig("support@gmail.com", "+910000000000", null))
.build();
snsSdk.launch();
} catch (Exception e) {
Timber.e(e);
}
showProgress(false);
}
Подробнее здесь: https://stackoverflow.com/questions/735 ... rorhandler
Я работаю над реализацией Sumsub SDK и получаю ошибку с классом SNSErrorHandler. ⇐ Android
Форум для тех, кто программирует под Android
1731448102
Anonymous
Я работаю над реализацией Sumsub SDK и получаю ошибку с классом SNSErrorHandler. Предлагается определить SNSAppActivity в файле Android Manifest.xml.
private void launchSdk(String accessToken, TokenExpirationHandler tokenUpdater) {//accessToken is coming from server (end pole) side.
List modules = Arrays.asList(new SNSProoface());
Context applicationContext = context.getApplicationContext();
SNSErrorHandler errorHandler = e -> {//Here I am getting error, It's saying to define SNSAppActivity in your Manifest.xml file
Timber.d("The SDK throws an exception. Exception: %s", e);
if (e instanceof SNSException.Api) {
Timber.d("Api exception. %s", ((SNSException.Api) e).getDescription());
} else if (e instanceof SNSException.Network) {
Timber.d(e, "Network exception.");
} else if (e instanceof SNSException.Unknown) {
Timber.d(e, "Unknown exception.");
}
Toast.makeText(applicationContext, "The SDK throws an exception. Exception: " + e, Toast.LENGTH_SHORT).show();
};
SNSStateChangedHandler stateChangedHandler = (previousState, currentState) -> {
Timber.d("The SDK state was changed: " + previousState + " -> " + currentState);
if (currentState instanceof SNSSDKState.Ready) {
Timber.d("SDK is ready");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.Failed.Unauthorized) {
Timber.e(((SNSSDKState.Failed.Unauthorized) currentState).getException(), "Invalid token or a token can't be refreshed by the SDK. Please, check your token expiration handler");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.Failed.Unknown) {
Timber.e(((SNSSDKState.Failed.Unknown) currentState).getException(), "Unknown error");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.Initial) {
Timber.d("No verification steps are passed yet");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.Incomplete) {
Timber.d("Some but not all verification steps are passed over");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.Pending) {
Timber.d("Verification is in pending state");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.FinallyRejected) {
Timber.d("Applicant has been finally rejected");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.TemporarilyDeclined) {
Timber.d("Applicant has been declined temporarily");
parseStatus(currentState);
} else if (currentState instanceof SNSSDKState.Approved) {
Timber.d("Applicant has been approved");
parseStatus(currentState);
}
if (currentState instanceof SNSSDKState.ActionCompleted) {
SNSSDKState.ActionCompleted actionState = (SNSSDKState.ActionCompleted) currentState;
String actionId = actionState.getActionId();
FlowActionType type = actionState.getType();
String answer = actionState.getAnswer();
Map payload = actionState.getPayload();
}
};
SNSCompleteHandler completeHandler = (result, state) -> {
Timber.d("The SDK is finished. Result: " + result + " , State: " + state);
Toast.makeText(applicationContext, "The SDK is finished. Result: " + result + ", State: " + state, Toast.LENGTH_SHORT).show();
if (result instanceof SNSCompletionResult.SuccessTermination) {
Timber.d(result.toString());
} else if (result instanceof SNSCompletionResult.AbnormalTermination) {
Timber.d(((SNSCompletionResult.AbnormalTermination) result).getException());
}
};
SNSActionResultHandler actionResultHandler = (actionId, actionType, answer, allowContinuing) -> {
Timber.d("Action Result: actionId: " + actionId + ", answer: " + answer);
return SNSActionResult.Continue;
};
SNSEventHandler eventHandler = snsEvent -> {
if (snsEvent instanceof SNSEvent.SNSEventStepInitiated) {
Timber.d("onEvent: step initiated");
} else if (snsEvent instanceof SNSEvent.SNSEventStepCompleted) {
Timber.d("onEvent: step completed");
}
};
SNSSupportItem supportItem = new SNSSupportItem(
R.string.sns_support_title,
R.string.sns_support_subtitle,
SNSSupportItem.Type.Email, "support@company.com", null,
SNSIconHandler.SNSCommonIcons.MAIL.getImageName(), null);
try {
SNSMobileSDK.SDK snsSdk = new SNSMobileSDK.Builder(context)
.withBaseUrl(apiUrl)
.withAccessToken(accessToken, tokenUpdater)
.withDebug(true)
.withModules(modules)
.withCompleteHandler(completeHandler)
.withErrorHandler(errorHandler)
.withStateChangedHandler(stateChangedHandler)
.withActionResultHandler(actionResultHandler)
.withEventHandler(eventHandler)
.withSupportItems(Collections.singletonList(supportItem))
.withConf(new SNSInitConfig("support@gmail.com", "+910000000000", null))
.build();
snsSdk.launch();
} catch (Exception e) {
Timber.e(e);
}
showProgress(false);
}
Подробнее здесь: [url]https://stackoverflow.com/questions/73510762/im-working-on-sumsub-sdk-implementation-getting-an-error-with-snserrorhandler[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия