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.
@@ -45,7 +45,7 @@ def supportsNamespace() {
45
45
  }
46
46
 
47
47
  plugins {
48
- id "org.jetbrains.kotlin.plugin.serialization" version "2.2.0"
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.9.0'
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
 
@@ -19,9 +19,5 @@ object ParserUtil {
19
19
  return res
20
20
  }
21
21
 
22
- inline fun <reified T> toJson(
23
- src: T,
24
- ): String = json.encodeToString(src)
25
-
26
22
  fun parse(json: String): JsonElement = this.json.parseToJsonElement(json)
27
23
  }
@@ -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
- return switch (value) {
42
- case "playground" -> KlarnaEnvironment.PLAYGROUND;
43
- case "staging" -> KlarnaEnvironment.STAGING;
44
- default -> KlarnaEnvironment.PRODUCTION;
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
- return switch (value) {
51
- case "na" -> KlarnaRegion.NA;
52
- case "oc" -> KlarnaRegion.OC;
53
- default -> KlarnaRegion.EU;
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) {
@@ -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
  );
@@ -6,6 +6,7 @@
6
6
  //
7
7
 
8
8
  #import <Foundation/Foundation.h>
9
+ #import <KlarnaMobileSDK/KlarnaMobileSDK.h>
9
10
  #import "KlarnaMobileSDK/KlarnaMobileSDK-Swift.h"
10
11
  #import <React/RCTBridgeModule.h>
11
12
 
@@ -6,6 +6,8 @@
6
6
  //
7
7
 
8
8
  #import "KlarnaSignInData.h"
9
+ #import <KlarnaMobileSDK/KlarnaMobileSDK.h>
10
+ #import <KlarnaMobileSDK/KlarnaMobileSDK-Swift.h>
9
11
 
10
12
  @implementation KlarnaSignInData
11
13
 
@@ -8,7 +8,10 @@
8
8
 
9
9
  #import <Foundation/Foundation.h>
10
10
  #import <React/RCTBridgeModule.h>
11
+ #import <KlarnaMobileSDK/KlarnaMobileSDK.h>
12
+ #ifdef RCT_NEW_ARCH_ENABLED
11
13
  #import <RNKlarnaMobileSDK/RNKlarnaMobileSDK.h>
14
+ #endif
12
15
 
13
16
  NS_ASSUME_NONNULL_BEGIN
14
17
 
@@ -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 "../KlarnaStandaloneWebViewWrapper.h"
4
4
 
5
5
  #import <AVFoundation/AVFoundation.h>
6
+ #import <KlarnaMobileSDK/KlarnaMobileSDK.h>
6
7
  #import <KlarnaMobileSDK/KlarnaMobileSDK-Swift.h>
7
8
  #import <React/RCTLog.h>
8
9
 
@@ -3,6 +3,7 @@
3
3
  #import "../PaymentViewWrapper.h"
4
4
 
5
5
  #import <AVFoundation/AVFoundation.h>
6
+ #import <KlarnaMobileSDK/KlarnaMobileSDK.h>
6
7
  #import <KlarnaMobileSDK/KlarnaMobileSDK-Swift.h>
7
8
  #import <React/RCTLog.h>
8
9
 
@@ -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>
@@ -2,6 +2,7 @@
2
2
 
3
3
  #import "../KlarnaStandaloneWebViewWrapper.h"
4
4
 
5
+ #import <KlarnaMobileSDK/KlarnaMobileSDK.h>
5
6
  #import <KlarnaMobileSDK/KlarnaMobileSDK-Swift.h>
6
7
  #import <React/RCTLog.h>
7
8
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  #import "../PaymentViewWrapper.h"
4
4
 
5
+ #import <KlarnaMobileSDK/KlarnaMobileSDK.h>
5
6
  #import <KlarnaMobileSDK/KlarnaMobileSDK-Swift.h>
6
7
  #import <React/RCTLog.h>
7
8
 
@@ -9,6 +9,7 @@
9
9
  #import <XCTest/XCTest.h>
10
10
  #import <OCMock/OCMock.h>
11
11
  #import <React/RCTComponent.h>
12
+ #import <KlarnaMobileSDK/KlarnaMobileSDK.h>
12
13
  #import <KlarnaMobileSDK/KlarnaMobileSDK-Swift.h>
13
14
  #import "../Sources/KlarnaPaymentViewManager.h"
14
15
 
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",
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 15'",
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"
@@ -48,5 +48,5 @@ Pod::Spec.new do |s|
48
48
  end
49
49
  end
50
50
 
51
- s.dependency 'KlarnaMobileSDK', '2.6.29'
51
+ s.dependency 'KlarnaMobileSDK', '2.7.3'
52
52
  end