For a stable integration we require all integrators to update their SDK version at least once every quarter to ensure the application uses a recent version of the SDK. This is mainly due to continuous development on Klarna products and the SDK are being aligned by each release along with the SDK specific improvements and the nature of native mobile development where we are required to cater for platform changes as much as your application does.
Both the hybrid and native integrations might, at some point, open third-party applications. To automatically return the user, these third-party applications need to know how to build a return intent or URL.
To do that, you’ll need to provide the SDK with what we call a “return URL” parameter. If you haven’t done so already, You can register an intent-filter for the Activity you’d like to return to in your app’s AndroidManifest.xml:
Important: Construct the return URL string passed to the SDK by combining the attributes defined in your <intent-filter>'s <data> tag, following the standard URL format: scheme://host:port/path
The hosting Activity should be using launchMode of type singleTask or singleTop to prevent a new instance from being created when returning from an external application.
There are some base properties that every integration in our SDK separately defines and uses in the process. These properties are declared in an Interface called KlarnaComponent that each integration implements and you can set or get their values:
Property
Type
Description
loggingLevel
KlarnaLoggingLevel
The level of events and errors that the integration will log to the console.
eventHandler
KlarnaEventHandler
The interface to receive results from the integration.
returnURL
String
The URL schema as defined in your AndroidManifest.xml to return from external applications.
region
KlarnaRegion
The geographical region of the user/application.
environment
KlarnaEnvironment
The working environment of the integration.
theme
KlarnaTheme
The style of integration in light and dark configurations.
resourceEndpoint
KlarnaResourceEndpoint
The resources endpoint configuration for the integration.
Some of the classes that implement these properties are
The SDK will log events and errors to the system’s log while running. You can set the logging level for the SDK using the loggingLevel property:
KOTLIN
1
2
3
4
// Example of how to set the logging level for an integrationval KlarnaPaymentView = KlarnaPaymentView(...)
KlarnaPaymentView.loggingLevel = KlarnaLoggingLevel.Verbose