react-native-klarna-inapp-sdk 2.4.4 → 2.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/klarna/mobile/sdk/reactnative/common/util/ParserUtil.kt +0 -4
- package/android/src/main/java/com/klarna/mobile/sdk/reactnative/signin/KlarnaSignInModuleImpl.java +16 -12
- package/android/src/test/java/com/klarna/mobile/sdk/reactnative/common/util/ParserUtilTest.kt +0 -14
- package/ios/RNKlarnaMobileSDK.xcodeproj/project.pbxproj +2 -0
- package/ios/Sources/signIn/KlarnaSignInData.h +1 -0
- package/ios/Sources/signIn/KlarnaSignInData.mm +2 -0
- package/ios/Sources/signIn/KlarnaSignInModule.h +3 -0
- package/ios/Sources/signIn/KlarnaSignInModuleImpl.mm +1 -0
- package/ios/Sources/view/newarch/KlarnaCheckoutViewWrapper.mm +1 -0
- package/ios/Sources/view/newarch/KlarnaStandaloneWebViewWrapper.mm +1 -0
- package/ios/Sources/view/newarch/PaymentViewWrapper.mm +1 -0
- package/ios/Sources/view/oldarch/KlarnaCheckoutViewWrapper.mm +1 -0
- package/ios/Sources/view/oldarch/KlarnaStandaloneWebViewWrapper.mm +1 -0
- package/ios/Sources/view/oldarch/PaymentViewWrapper.mm +1 -0
- package/ios/Tests/PaymentViewWrapperTests.m +1 -0
- package/package.json +2 -2
- package/react-native-klarna-inapp-sdk.podspec +1 -1
package/android/build.gradle
CHANGED
|
@@ -45,7 +45,7 @@ def supportsNamespace() {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
plugins {
|
|
48
|
-
id "org.jetbrains.kotlin.plugin.serialization" version "
|
|
48
|
+
id "org.jetbrains.kotlin.plugin.serialization" version "1.9.25"
|
|
49
49
|
}
|
|
50
50
|
apply plugin: 'com.android.library'
|
|
51
51
|
apply plugin: 'kotlin-android'
|
|
@@ -112,7 +112,7 @@ dependencies {
|
|
|
112
112
|
|
|
113
113
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:${getExtOrDefault('kotlinVersion')}"
|
|
114
114
|
implementation "org.jetbrains.kotlin:kotlin-reflect:${getExtOrDefault('kotlinVersion')}"
|
|
115
|
-
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.
|
|
115
|
+
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3'
|
|
116
116
|
|
|
117
117
|
implementation 'com.klarna.mobile:sdk:2.7.1'
|
|
118
118
|
|
package/android/src/main/java/com/klarna/mobile/sdk/reactnative/signin/KlarnaSignInModuleImpl.java
CHANGED
|
@@ -38,21 +38,25 @@ public class KlarnaSignInModuleImpl implements KlarnaEventHandler {
|
|
|
38
38
|
/* Module private methods */
|
|
39
39
|
|
|
40
40
|
private KlarnaEnvironment environmentFrom(@NonNull String value) {
|
|
41
|
-
|
|
42
|
-
case "playground"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
switch (value) {
|
|
42
|
+
case "playground":
|
|
43
|
+
return KlarnaEnvironment.PLAYGROUND;
|
|
44
|
+
case "staging":
|
|
45
|
+
return KlarnaEnvironment.STAGING;
|
|
46
|
+
default:
|
|
47
|
+
return KlarnaEnvironment.PRODUCTION;
|
|
48
|
+
}
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
private KlarnaRegion regionFrom(@NonNull String value) {
|
|
50
|
-
|
|
51
|
-
case "na"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
switch (value) {
|
|
53
|
+
case "na":
|
|
54
|
+
return KlarnaRegion.NA;
|
|
55
|
+
case "oc":
|
|
56
|
+
return KlarnaRegion.OC;
|
|
57
|
+
default:
|
|
58
|
+
return KlarnaRegion.EU;
|
|
59
|
+
}
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
private KlarnaSignInData getInstanceData(KlarnaComponent component) {
|
package/android/src/test/java/com/klarna/mobile/sdk/reactnative/common/util/ParserUtilTest.kt
CHANGED
|
@@ -14,20 +14,6 @@ internal class ParserUtilTest {
|
|
|
14
14
|
assertNotNull(ParserUtil.json)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
@Test
|
|
18
|
-
fun `test toJson success`() {
|
|
19
|
-
val serialized = ParserUtil.toJson(TestData("test"))
|
|
20
|
-
assertEquals("{\"data\":\"test\"}", serialized)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@Test
|
|
24
|
-
fun `test toJson fail`() {
|
|
25
|
-
val testData = NonSerializableData("")
|
|
26
|
-
assertFailsWith(SerializationException::class, "test") {
|
|
27
|
-
ParserUtil.toJson(testData)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
17
|
@Serializable
|
|
32
18
|
private data class TestData(
|
|
33
19
|
@SerialName("data") val data: String,
|
|
@@ -338,11 +338,13 @@
|
|
|
338
338
|
);
|
|
339
339
|
inputPaths = (
|
|
340
340
|
"${PODS_ROOT}/Target Support Files/Pods-RNKlarnaMobileSDK-RNKlarnaMobileSDKTests/Pods-RNKlarnaMobileSDK-RNKlarnaMobileSDKTests-frameworks.sh",
|
|
341
|
+
"${PODS_XCFRAMEWORKS_BUILD_DIR}/KlarnaMobileSDK/basic/KlarnaCore.framework/KlarnaCore",
|
|
341
342
|
"${PODS_XCFRAMEWORKS_BUILD_DIR}/KlarnaMobileSDK/basic/KlarnaMobileSDK.framework/KlarnaMobileSDK",
|
|
342
343
|
"${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes",
|
|
343
344
|
);
|
|
344
345
|
name = "[CP] Embed Pods Frameworks";
|
|
345
346
|
outputPaths = (
|
|
347
|
+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KlarnaCore.framework",
|
|
346
348
|
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KlarnaMobileSDK.framework",
|
|
347
349
|
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework",
|
|
348
350
|
);
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#import "KlarnaSignInModuleImpl.h"
|
|
9
9
|
#import "../common/RNMobileSDKUtils.h"
|
|
10
10
|
#import <AuthenticationServices/AuthenticationServices.h>
|
|
11
|
+
#import <KlarnaMobileSDK/KlarnaMobileSDK.h>
|
|
11
12
|
#import "KlarnaMobileSDK/KlarnaMobileSDK-Swift.h"
|
|
12
13
|
#import <React/RCTLog.h>
|
|
13
14
|
#import "KlarnaSignInData.h"
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#import "../KlarnaCheckoutViewWrapper.h"
|
|
10
10
|
#import "../../common/RNMobileSDKUtils.h"
|
|
11
11
|
#import "RCTFabricComponentsPlugins.h"
|
|
12
|
+
#import <KlarnaMobileSDK/KlarnaMobileSDK.h>
|
|
12
13
|
#import <KlarnaMobileSDK/KlarnaMobileSDK-Swift.h>
|
|
13
14
|
|
|
14
15
|
using namespace facebook::react;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
#import <React/RCTLog.h>
|
|
4
4
|
#import "../KlarnaCheckoutViewWrapper.h"
|
|
5
5
|
#import "../../common/RNMobileSDKUtils.h"
|
|
6
|
+
#import <KlarnaMobileSDK/KlarnaMobileSDK.h>
|
|
6
7
|
#import <KlarnaMobileSDK/KlarnaMobileSDK-Swift.h>
|
|
7
8
|
|
|
8
9
|
@interface KlarnaCheckoutViewWrapper () <KlarnaEventHandler, KlarnaSizingDelegate>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-klarna-inapp-sdk",
|
|
3
3
|
"title": "Klarna Mobile SDK React Native",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.6",
|
|
5
5
|
"description": "This library wraps Klarna Mobile SDK and exposes its functionality as React Native components.",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
7
7
|
"module": "lib/module/index",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"clean": "del-cli android/build ios/build TestApp/android/build TestApp/android/app/build TestApp/ios/build",
|
|
41
41
|
"pods": "pod-install --quiet",
|
|
42
42
|
"test:android": "cd TestApp/android && ./gradlew :react-native-klarna-inapp-sdk:testDebugUnitTest && cd ../..",
|
|
43
|
-
"test:ios": "cd ios && xcodebuild test -workspace RNKlarnaMobileSDK.xcworkspace -scheme RNKlarnaMobileSDK -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone
|
|
43
|
+
"test:ios": "cd ios && xcodebuild test -workspace RNKlarnaMobileSDK.xcworkspace -scheme RNKlarnaMobileSDK -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16'",
|
|
44
44
|
"build:android": "cd TestApp/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
|
|
45
45
|
"build:ios": "cd TestApp/ios && xcodebuild -workspace TestApp.xcworkspace -scheme TestApp -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO",
|
|
46
46
|
"TestApp": "yarn --cwd TestApp"
|