If you want to add the SDK via npm
use the following command to install and save it.
If you want to add the SDK automatically to your React Native project use the following command.
This will configure your iOS project with Cocoapods and Android project with Gradle.
We strongly encourage you to use CocoaPods to manage the library and follow the instructions below to add the SDK as a dependency to the React Native app. If you add the SDK to CocoaPods elsewhere in the application it may cause the SDK to not be visible to the library.
npm install react-native-klarna-inapp-sdk --save
go to [your project]/ios folder.3. Insert the following lines inside the dependencies block in android/app/build.gradle:
We’ve experienced issues with React Native 59 and above where 3rd party Gradle repositories won’t be recognized in the Android project’s build.gradle. To address this, you need to add a reference to the repository in your own app’s build.gradle which can be done by adding the lines between the comments below:
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 the “Return URL” parameter. If you haven’t done so already, follow this documentation for Android and this documentation for iOS.
In order to use the SDK from your React Native application import it by: