Git Product home page Git Product logo

klarna-mobile-sdk's Introduction

Klarna Mobile SDK for iOS

Cocoapods Platform License Developed at Klarna

Klarna Mobile SDK is the best and only official way to integrate Klarna products into your mobile app.

We offer a seamless and straightforward way to

  • Render individual payment methods through Klarna Payments
  • Present a fully-featured checkout through Klarna Checkout
  • Give your customers a running start into the purchasing flow with On-site Messaging
  • Let customers quickly and safely sign for your platform using their Klarna account via Sign in with Klarna

and so much more in a single package!

SDK for Other Platforms

Overview

Requirements

  • iOS 10 or later.

Documentations

Changelog

Integrations

Klarna Mobile SDK offers two different integration types; standalone and WebView. Both of these types include multiple product integrations underneath and they are separated by the integration API offered by the SDK.

Standalone Integrations

Standalone integrations are product integrations offered with native API. Most of these integrations are fully native while there are some integrations that are using WebView internally. This means even if the integration is via a WebView you don't have to manage a WebView instance and instead you get a customized View or SDK instance that you can use directly with native APIs.

WebView Integrations

WebView integrations are solely based on WebViews and targeted to apps using WebViews in some parts of the app such as using Web checkout solutions in an app. These integrations either let integrator own a WebView or offer a WebView that's customized by the SDK and ready to be used out of the box.

Example Apps

Standalone Integration
WebView Integration

Support

If you are having any issues using the SDK in your project or if you think that something is wrong with the SDK itself, please follow our support guide.

Contribution

If you want to contribute to this project please follow our contribution guide.

License

This project is licensed under Apache License, Version 2.0.

klarna-mobile-sdk's People

Contributors

adrianpalmquist avatar gbanfalvi avatar gbanfalvikl avatar jorgepalac1o avatar klarna-msdk avatar mahmoudjafarinejad avatar mkgithub avatar nandotwang avatar nmguner avatar omarbh avatar polar133 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

klarna-mobile-sdk's Issues

iOS App will not build on Xcode 11.4 with KlarnaMobileSDK imported

Hello, I'm unable to build the app with Klarna 2.0.10 imported with the newest Xcode 11.4. The following error is displayed:

Module compiled with Swift 5.1.3 cannot be imported by the Swift 5.2 compiler: (...)/Pods/KlarnaMobileSDK/ios/xcode-11.3.1-fat/KlarnaMobileSDK.framework/Modules/KlarnaMobileSDK.swiftmodule/x86_64-apple-ios-simulator.swiftmodule

Steps to reproduce the behavior:

  1. Add pod 'KlarnaMobileSDK/xcode-11.3.1-fat', '2.0.10' to the Podfile
  2. Add import KlarnaMobileSDK in any of the Swift files
  3. Build

Expected behavior
The whole workspace is expected to build successfully.

Screenshots
If applicable, add screenshots to help explain your problem.

Device and version:

  • Xcode 11.4
  • Swift 5.2 compiler

[iOS] Umbrella header for module 'KlarnaMobileSDK' does not include header 'KlarnaMobileSDKPostfix.h'

Describe the bug
After upgrading from version 2.1.7 to 2.6.6 and compiling, the following errors are thrown:

  • Umbrella header for module 'KlarnaMobileSDK' does not include header 'KlarnaMobileSDKPostfix.h'
  • Pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) in KlarnaMobileSDK-Swift.h
  • Could not build module 'KlarnaMobileSDK'

To Reproduce
Steps to reproduce the behavior:

  1. Changed version of the SPM Klarna package from 2.1.7 to 2.6.6
  2. Compile
  3. Also tested cleaning derived data and build folder before compilation

Expected behavior
Correct compilation of the module

Device and version:

  • Xcode 14.2, building for simulator on a M1
  • Klarna In-App SDK version: 2.6.6 (tested also with 2.4.0 onwards)

Additional context
I found that the only way to compile is disabling the following compiler options:

  • Treat warnings as errors in Apple Clang
  • Treat warnings as errors in Swift Compiler
    but, of couse, we would like to have these settings active as before.

[iOS][Swift Package] Add Binary Target for Basic Version of SDK to Package.swift

Is your feature request related to a problem? Please describe.
When trying to integrate KlarnaMobileSDK using SPM (Swift Package Manager), I noticed that only the binary target for the full version of the SDK is available:

https://github.com/klarna/klarna-mobile-sdk/blob/master/Package.swift

// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

let package = Package(
    name: "KlarnaMobileSDK",
    products: [
        .library(
            name: "KlarnaMobileSDK",
            targets: ["KlarnaMobileSDK"]),
    ],
    dependencies: [],
    targets: [
        .binaryTarget(
            name: "KlarnaMobileSDK",
            path: "ios/XCFramework/full/universal/KlarnaMobileSDK.xcframework"
        )
    ]
)

My team would prefer the integration via Swift Package Manager, but we only need the basic version. Thus, we are forced to use Cocoapods in order to only select the basic one.

Describe the solution you'd like
I am proposing adding an extra binary target for the basic version of KlarnaMobileSDK to Package.swift in order to support the option for users to integrate the basic version with SPM.

Describe alternatives you've considered
The alternative we have considered and will pursue for now: Using Cocoapods to integrate the SDK and specify the basic subspec in the podfile.

Additional context
My team only requires the basic SDK without any of the additional features such as Card Scanning.

Hybrid Integration on Android

Describe the bug
Hello,I referred to the extensive documentation to integrate your SDK. When I clicked the relevant agreement on the payment page, I flipped two layers of the dialog to let me choose the default browser without setting the default browser, as in this video

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'webview pay'
  2. Click on 'User-related agreement'
  3. Scroll down to '....'
  4. See error

Screenshots
https://youtu.be/NWql0KKZYSQ

Device and version:

  • Device: [e.g. Nokia X6 、Samsung S9]
  • OS: [e.g. android 9.0]
  • SDK Version [e.g. 28]

Provide binary framework as XCFramework

name about title labels assignees
Provide binary framework as XCFramework Improving the way the apps integrate the SDK  Provide binary framework as XCFramework    

Is your feature request related to a problem? Please describe. Klarna mobile SDK are currently providing multiple folders depending on the version of Xcode and fat/slim options for different architectures. In big development teams where not everybody has the same version of Xcode on occasions it's a problem. Moreover, in case you need to debug on Simulator, the fat version is need while for uploading to the App Store you need to take the slim one.

Describe the solution you'd like Providing the SDK as XCFramework would fix all those problems I mentioned above. https://developer.apple.com/videos/play/wwdc2019/416/

For example, during these days some of the developers in my team already use Xcode 12 so they need the version 2.0.22 you just released on Friday but our CI environment cannot be migrated yet. Using a xcframework would let us to have a unique dependency and let Xcode to take the corresponding binary.

We're using v2.0.21 and thinking in adopt v2.0.22

Can't handle initialize error Klarna Payment View

Describe the bug
KlarnaPaymentView can't be initialized. It fails on "SentInitializeResponse" event. What is the cause of it?

To Reproduce
Steps to reproduce the behavior:

  1. Get client token
  2. Start klarnaPaymentView initialize method
  3. Client token is verified
  4. We have I/chromium: [INFO:CONSOLE(0)] "Uncaught (in promise) TypeError: Failed to fetch", source: file:///data/user/0/com.alexxer.myapplication/files/kp_index.html?mockkp=true&storeall=true&loglevel=0&endpoint=aws

Screenshots

image
image
image

Device and version:

  • Pixel 5
  • API 29
  • Klarna In-App SDK version 2.1.0

Impact Level
Blocking development

Additional context
Add any other context about the problem here.

leak in this lib

Describe the bug
leak in this lib is version 2.5.2
implementation 'com.klarna.mobile:sdk-basic:2.5.2'

To Reproduce

                                                                                                HEAP ANALYSIS RESULT
                                                                                                ====================================
                                                                                                1 APPLICATION LEAKS
                                                                                                
                                                                                                References underlined with "~~~" are likely causes.
                                                                                                Learn more at https://squ.re/leaks.
                                                                                                
                                                                                                229403 bytes retained by leaking objects
                                                                                                Signature: 2a628e9a26b5a6396b3b7a2c1c03abe03ee93ac1
                                                                                                ┬───
                                                                                                │ GC Root: Global variable in native code
                                                                                                │
                                                                                                ├─ J1 instance
                                                                                                │    Leaking: UNKNOWN
                                                                                                │    Retaining 230.6 kB in 4402 objects
                                                                                                │    ↓ WindowAndroid.p
                                                                                                │                    ~
                                                                                                ├─ b30 instance
                                                                                                │    Leaking: UNKNOWN
                                                                                                │    Retaining 229.4 kB in 4355 objects
                                                                                                │    ↓ b30.b
                                                                                                │          ~
                                                                                                ├─ com.android.internal.policy.PhoneWindow instance
                                                                                                │    Leaking: YES (Window#mDestroyed is true)
                                                                                                │    Retaining 229.4 kB in 4354 objects
                                                                                                │    mContext instance of com.xx.xxx..KlarnaPayActivity with mDestroyed = true
                                                                                                │    mOnWindowDismissedCallback instance of com.xx.xxx..KlarnaPayActivity with mDestroyed =
                                                                                                │    true
                                                                                                │    ↓ Window.mContext
                                                                                                ╰→ com.xx.xxx..KlarnaPayActivity instance
                                                                                                ​     Leaking: YES (ObjectWatcher was watching this because com.xxx.xxx.KlarnaPayActivity
                                                                                                ​     received Activity#onDestroy() callback and Activity#mDestroyed is true)
                                                                                                ​     Retaining 163.6 kB in 3394 objects
                                                                                                ​     key = e0fb6dce-95a3-44b9-bd15-0bc0d6e06fa0
                                                                                                ​     watchDurationMillis = 21707
                                                                                                ​     retainedDurationMillis = 16676
                                                                                                ​     mContext instance of com.xx.xxx..KlarnaPayActivity with mDestroyed = true
                                                                                                ​     mApplication instance of com.xx.xxx..BaseApplication
                                                                                                ​     mBase instance of androidx.appcompat.view.ContextThemeWrapper
                                                                                                ====================================
                                                                                                0 LIBRARY LEAKS
                                                                                                
                                                                                                A Library Leak is a leak caused by a known bug in 3rd party code that you do not have control over.
                                                                                                See https://square.github.io/leakcanary/fundamentals-how-leakcanary-works/#4-categorizing-leaks
                                                                                                ====================================
                                                                                                0 UNREACHABLE OBJECTS
                                                                                                
                                                                                                An unreachable object is still in memory but LeakCanary could not find a strong reference path
                                                                                                from GC roots.
                                                                                                ====================================
                                                                                                METADATA
                                                                                                
                                                                                                Please include this in bug reports and Stack Overflow questions.
                                                                                                
                                                                                                Build.VERSION.SDK_INT: 33
                                                                                                Build.MANUFACTURER: samsung
                                                                                                LeakCanary version: 2.10
                                                                                                App process name: com.xx.xx
                                                                                                Class count: 34284
                                                                                                Instance count: 345575
                                                                                                Primitive array count: 187639
                                                                                                Object array count: 46496
                                                                                                Thread count: 147
                                                                                                Heap total bytes: 52107809
                                                                                                Bitmap count: 139
                                                                                                Bitmap total bytes: 56022959
                                                                                                Large bitmap count: 0
                                                                                                Large bitmap total bytes: 0
                                                                                                Db 1: open /data/user/0/xxx/databases/com.google.android.datatransport.events
                                                                                                Db 2: closed /data/user/0/xxx/databases/google_app_measurement_local.db
                                                                                                Db 3: open /data/user/0/com.xxx/databases/sensorsdata
                                                                                                Stats: LruCache[maxSize=3000,hits=151499,misses=311406,hitRate=32%]
                                                                                                RandomAccess[bytes=17037677,reads=311406,travel=182829173186,range=50208752,size=70690968]
                                                                                                Heap dump reason: user request
                                                                                                Analysis duration: 15033 ms
                                                                                                Heap dump file path: /storage/emulated/0/Download/leakcanary-com.xxxx.xxx/2023-02-23_10-00-08_203.hprof
                                                                                                Heap dump timestamp: 1677117628730
                                                                                                Heap dump duration: 2908 ms

KlarnaMobileSDK not compatible with Swift 5.3 and Xcode 12

Describe the bug
SDK can't be imported in xCode 12 with swift 5.3.

To Reproduce
Steps to reproduce the behavior:

  1. Install xCode 12 (GM seed - https://developer.apple.com/xcode/)
  2. Update to latest version of KlarnaMobileSDK (2.0.21)
  3. Open project and open file with the line "import KlarnaMobileSDK"
  4. Warning stating that: "Module compiled with Swift 5.2.4 cannot be imported by the Swift 5.3 compiler: /Pods/KlarnaMobileSDK/ios/xcode-11.7-fat/KlarnaMobileSDK.framework/Modules/KlarnaMobileSDK.swiftmodule/arm64-apple-ios.swiftmodule" appears.

Expected behavior
For KlarnaMobileSDK to be able to be imported with Swift 5.3 compiler.

Screenshots
N/A

Device and version:

  • Device: N/A
  • OS version: N/A
  • Klarna In-App SDK version 2.0.21
  • xCode version 12.0 (12A7209)
  • Swift version 5.3

Additional context
I need to be able to compile my app with KlarnaMobileSDK in xCode 12 and Swift 5.3 to adapt my app to the new changes in iOS 14.
I realise that xCode 12 was released as a GM seed yesterday so I fully understand why it doesn't work yet, but I thought I might as well "get the ball rolling" :)

Seems proguard file not contain "-dontusemixedcaseclassnames" command

Describe the bug
when I import klarna SDK. Sometime build failed.

log info:

Caused by: com.android.tools.r8.errors.b: Class content provided for type descriptor com.getbouncer.cardscan.base.r actually defines class com.getbouncer.cardscan.base.R

it looks like Klarna dependent on getbouncer library. And the proguard file don't contain "-dontusemixedcaseclassnames" command. So at some filesystem while get failed.

KlarnaPaymentViewCallback not calling onAuthorized with pay_now option.

Describe the bug
Using pay_now payment option sdk interalBrowser does not call onAuthorized callback function on Android.

To Reproduce
Select direct bank transfer payment option, continue thought the payment pipeline untill thank you message. onAuthorized is not called here.

Expected behavior
At thank you message KlarnaPaymentViewCallback is expected to call onAuthorized

Screenshots
Screenshot 2023-06-01 at 12 19 36

Device and version:

  • Device: Any android phone
  • OS version: Any
  • Klarna In-App SDK version [e.g. 1.2.3]: 2.6.2

Impact Level
Navigation back to app and giving feedback to user about his payment status is dependent on getting onAuthorized call. Now the user is just stuck to klarna thank you message and have to manually backtrack all the steps.

Additional context
Other payment methods work as expected.

Unable to get provider com.klarna.mobile.KlarnaInitProvider

Describe the bug

It looks when an Activity tries to spin up the Content Provider within the Klarna In-App store SDK we get a ClassNotFoundException. We've seen only a few instances of this in Crashlytics but we figured it should be on the radar. We believe this is due to an issue with the Android OS.

To Reproduce
We haven't been able to reproduce this.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Device and version:

  • Device: LG G5
  • OS version: 8.0.0
  • Klarna In-App SDK version 2.2.0

Merchant Name
Lululemon

Impact Level
Minimal and is not blocking development

Additional context
Fatal Exception: java.lang.RuntimeException: Unable to get provider com.klarna.mobile.KlarnaInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.klarna.mobile.KlarnaInitProvider" on path: DexPathList[[zip file "/data/app/com.lululemon.shop-33bKhC-uPO9phguBoDchBw==/base.apk"],nativeLibraryDirectories=[/data/app/com.lululemon.shop-33bKhC-uPO9phguBoDchBw==/lib/arm64, /data/app/com.lululemon.shop-33bKhC-uPO9phguBoDchBw==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
at android.app.ActivityThread.installProvider(ActivityThread.java:6437)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6000)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5912)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1680)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6710)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)

Unable to install app on physical device using SPM

Describe the bug
When we try add KlarnaMobileSDK using SPM the app is unable to install on physical device

To Reproduce
We add klarna-mobile-sdk to a core library and the app is unable to install. The structure of project is:

App > Core Library > KlarnaMobileSDK (with SPM)

Compile and run, xcode show a alert message "Unable to Install app".

Screenshots
Screenshot 2020-11-13 at 11 24 55

Device and version:

  • Device: iPod 7th gen
  • OS version: iOS 13.5.1
  • Klarna: lastest SPM version

Additional context
Adding the sdk manually it works.
In the simulator SPM works.
I see that Firebase was a similar problem. firebase/firebase-ios-sdk#6360

KlarnaOSMView - Crash in iPad on clicking share button

Describe the bug
KlarnaOSMView have learn more as hyperlink and clicking on hyperlink, opens web controller ProgressNavigationController and then if you click share button in iPad, it crashes

To Reproduce
Steps to reproduce the behavior:

  1. Go to ProgressNavigationController from KlarnaOSMView
  2. Click on ShareButton in bottom toolbar
  3. App will crash with this exception "UIPopoverPresentationController should have a non-nil sourceview or barButtonItem set before the presentation occurs.

Expected behavior
App should not crash

Screenshots
If applicable, add screenshots to help explain your problem.

Device and version:

  • iPad
  • OS version: Any OS version
  • Klarna In-App SDK version - Currently using 2.6.4

Merchant Name
Please state the merchant's name and the application's name that is facing the issue using the SDK.

Impact Level
What is the impact level of this bug on the merchant and its customers? Is it happening in production? Is it a blocking issue for development? etc.

Additional context
Add any other context about the problem here.

Klarna payment view auth problem

Describe the bug
I am writing native android module for flutter with using klarna SDK. I have custom view with klarna payment view and when Klarna payment view authorizes I have endless progress and no auth fields. In logs I have that Klarna payment view is AppCompat widjet and we should use AppCompat theme. But theme extends from AppCompat. In some sources told that we should have AppCompatActivity and AppCompat theme. But for render native view from flutter we need to extend activity from FlutterActivity.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image
image
image
image

Device and version:
Pixel 5
API 29
Klarna In-App SDK version 2.1.0

Clear background and reusing window

Describe the bug
It is a bug connected with transparent navigation bar color. And so we can see the layers below.

To Reproduce
Steps to reproduce the behavior:

  1. Install version 2.1.0 of KlarnaMobileSDK
  2. Update Xcode to version 13.0
  3. Open Pay now option
  4. Choose "Terms for the Klarna Shopping Sevice"
  5. See clear UINavigationBar color inside ProgressNavigationController

Expected behavior
A solid color, for example: white.
Or color related with system theme.

Screenshots

Снимок экрана 2021-11-16 в 19 09 29

Device and version:

  • Device: iPhone 13 Pro Max
  • OS version: iOS 15.0
  • Klarna In-App SDK version 2.1.0

Merchant Name
I'd rather not state this here unless absolutely necessary.

Impact Level
This is an unpleasant mistake for which I had to make a workaround using UIAppearance.

Additional context
While I was researching the problem, I found another minor issue.
If we open and close the "Terms for the Klarna Shopping Sevice" multiple times we will see a lot of extra windows inside UIWindowScene.windows array:
<__NSArrayM 0x600003dda250>( <KlarnaMobileSDK.KlarnaWindow: 0x7fd410f12590; baseClass = UIWindow; frame = (0 0; 428 926); hidden = YES; gestureRecognizers = <NSArray: 0x600003997e70>; layer = <UIWindowLayer: 0x6000039959b0>>,

<KlarnaMobileSDK.KlarnaWindow: 0x7fd41206c970; baseClass = UIWindow; frame = (0 0; 428 926); hidden = YES; gestureRecognizers = <NSArray: 0x600007a9fea0>; layer = <UIWindowLayer: 0x600007a9ec10>>,

<KlarnaMobileSDK.KlarnaWindow: 0x7fd3fa9977f0; baseClass = UIWindow; frame = (0 0; 428 926); hidden = YES; gestureRecognizers = <NSArray: 0x60000a7aa4c0>; layer = <UIWindowLayer: 0x60000a7a9cb0>>,

<KlarnaMobileSDK.KlarnaWindow: 0x7fd3cd631670; baseClass = UIWindow; frame = (0 0; 428 926); gestureRecognizers = <NSArray: 0x60000bcdc3c0>; layer = <UIWindowLayer: 0x60000bcde280>>, …

I think there is a bug that every time a new window is created instead of reusing the old one.

Android: KlarnaCheckoutView and WRAP_CONTENT layout params

Describe the bug
For my life, I just can't make the KlarnaCheckoutView size dynamically to its content.

I have a React Native application, that I am trying to add the KlarnaCheckoutView to. The problem is that I want the containing view to automatically resize to the current size of the KlarnaCheckoutView.

What I am doing is

public class KlarnaCheckoutViewWrapper extends FrameLayout {
    public KlarnaCheckoutViewWrapper(ThemedReactContext context) {
        super(context);
        setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        mKlarnaCheckout = new KlarnaCheckoutView(context.getCurrentActivity());
        mKlarnaCheckout.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
        addView(mKlarnaCheckout);
    }
}

but whatever I do, the KlarnaCheckoutView always has 0 height.

Expected behavior
I would expect the KlarnaCheckoutView to report a height greater than zero

Device and version:

  • Device: Android Emulator
  • OS version: Seems to happen in all versions
  • Klarna In-App SDK version 2.5.0

Merchant Name
Rather not say

Impact Level
Blocker

Adding Klarna SDK to our App increases our APK (downloadable) size by 5MB

Describe the bug
After adding the Klarna In App Android SDK to our app, our App (downloadable) size increased by over 5 MB and overall app size increased by 10 MB (uncompressed).

To Reproduce
Build a release build with Klarna SDK. Analyze the APK using APK Analyzer.

Expected behavior
To not increase our App size so significantly.

Screenshots
Screenshot 2022-03-29 at 17 42 45

Device and version:

  • Device: All
  • OS version: All
  • Klarna In-App SDK version 2.1.5

Merchant Name
Vestiaire Collective

Impact Level
It increased our App size drastically which can have a negative impact on our app propagation.

Additional context
I did some digging on why the apk size increases so drastically. The main contributor is the Tensorflow lite dependency. (org.tensorflow:tensorflow-lite:1.15.0) It adds a bunch binaries that contribute directly to the increase in apk size. (libtensorflowlite_jni.so files)
Screenshot 2022-03-21 at 21 52 45
It also adds a resource file which is over 1 MB - FJ.tflite
I tried excluding the dependency but then the In App SDK stopped working.

Camera requirements in SDK Manifest are mandatory

Describe the bug
When preparing a release for OSM on Android, I discovered that the Klarna SDK declares a camera requirement that differs from our app’s requirements that is NOT mentioned in the documentation. Is there a way to make these features optional in your SDK? Releasing our app with the Klarna SDK as is will result in dropping support for devices without cameras.

From the Klarna SDK’s AndroidManifest.xml file:

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.FLASHLIGHT" />
    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />

Expected behavior
These camera requirements can be made optional with a required=false tag, ie:

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.FLASHLIGHT" />
    <uses-feature android:name="android.hardware.camera" android:required="false" />
    <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
    (something similar for the flashlight permission)

Screenshots
Screen Shot 2021-07-20 at 12 19 32 PM

Device and version:

  • Device: Android
  • Klarna In-App SDK version: 2.0.42

Merchant Name
Babylist

Impact Level
Blocking release, dropping supported devices

Additional context

Fix documentation comments in iOS framework headers

Describe the bug
There are 12 mistakes in the documentation comments in iOS header files: invalid attribute names following \param.

Build log
While building module 'KlarnaMobileSDK' imported from /Users/username/Library/Developer/Xcode/DerivedData/Joom-akeatjfowkfevbbngigumbyiohif/Build/Intermediates.noindex/Joom.build/Debug-iphonesimulator/Joom.build/DerivedSources/Joom-Swift.h:214:
In file included from <module-includes>:2:
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:273:12: warning: parameter 'returnUrl' not found in the function declaration [-Wdocumentation]
/// \param returnUrl Your apps custom URL scheme <code>CFBundleURLSchemes</code>.
           ^~~~~~~~~
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:273:12: note: did you mean 'returnURL'?
/// \param returnUrl Your apps custom URL scheme <code>CFBundleURLSchemes</code>.
           ^~~~~~~~~
           returnURL
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:281:12: warning: parameter 'returnUrl' not found in the function declaration [-Wdocumentation]
/// \param returnUrl Your apps custom URL scheme <code>CFBundleURLSchemes</code>.
           ^~~~~~~~~
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:281:12: note: did you mean 'returnURL'?
/// \param returnUrl Your apps custom URL scheme <code>CFBundleURLSchemes</code>.
           ^~~~~~~~~
           returnURL
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:340:12: warning: parameter 'returnUrl' not found in the function declaration [-Wdocumentation]
/// \param returnUrl Your apps custom URL scheme <code>CFBundleURLSchemes</code>.
           ^~~~~~~~~
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:340:12: note: did you mean 'returnURL'?
/// \param returnUrl Your apps custom URL scheme <code>CFBundleURLSchemes</code>.
           ^~~~~~~~~
           returnURL
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:348:12: warning: parameter 'returnUrl' not found in the function declaration [-Wdocumentation]
/// \param returnUrl Your apps custom URL scheme <code>CFBundleURLSchemes</code>.
           ^~~~~~~~~
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:348:12: note: did you mean 'returnURL'?
/// \param returnUrl Your apps custom URL scheme <code>CFBundleURLSchemes</code>.
           ^~~~~~~~~
           returnURL
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:577:12: warning: parameter 'eventListener' not found in the function declaration [-Wdocumentation]
/// \param eventListener A listener that will receive events from the SDK.
           ^~~~~~~~~~~~~
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:577:12: note: did you mean 'klarnaEventListener'?
/// \param eventListener A listener that will receive events from the SDK.
           ^~~~~~~~~~~~~
           klarnaEventListener
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:579:12: warning: parameter 'fullscreenEventListener' not found in the function declaration [-Wdocumentation]
/// \param fullscreenEventListener Listener that will notify fullscreen events.
           ^~~~~~~~~~~~~~~~~~~~~~~
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:579:12: note: did you mean 'klarnaEventListener'?
/// \param fullscreenEventListener Listener that will notify fullscreen events.
           ^~~~~~~~~~~~~~~~~~~~~~~
           klarnaEventListener
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:589:12: warning: parameter 'eventListener' not found in the function declaration [-Wdocumentation]
/// \param eventListener A listener that will receive events from the SDK.
           ^~~~~~~~~~~~~
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:589:12: note: did you mean 'klarnaEventListener'?
/// \param eventListener A listener that will receive events from the SDK.
           ^~~~~~~~~~~~~
           klarnaEventListener
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:591:12: warning: parameter 'fullscreenEventListener' not found in the function declaration [-Wdocumentation]
/// \param fullscreenEventListener Listener that will notify fullscreen events.
           ^~~~~~~~~~~~~~~~~~~~~~~
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:591:12: note: did you mean 'klarnaEventListener'?
/// \param fullscreenEventListener Listener that will notify fullscreen events.
           ^~~~~~~~~~~~~~~~~~~~~~~
           klarnaEventListener
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:957:12: warning: parameter 'delegate' not found in the function declaration [-Wdocumentation]
/// \param delegate A listener object that will receive events from this view.
           ^~~~~~~~
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:957:12: note: did you mean 'eventListener'?
/// \param delegate A listener object that will receive events from this view.
           ^~~~~~~~
           eventListener
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:973:12: warning: parameter 'delegate' not found in the function declaration [-Wdocumentation]
/// \param delegate A listener object that will receive events from this view.
           ^~~~~~~~
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:973:12: note: did you mean 'eventListener'?
/// \param delegate A listener object that will receive events from this view.
           ^~~~~~~~
           eventListener
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:987:12: warning: parameter 'delegate' not found in the function declaration [-Wdocumentation]
/// \param delegate A listener object that will receive events from this view.
           ^~~~~~~~
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:987:12: note: did you mean 'eventListener'?
/// \param delegate A listener object that will receive events from this view.
           ^~~~~~~~
           eventListener
/path/to/project/Carthage/Build/iOS/KlarnaMobileSDK.framework/Headers/KlarnaMobileSDK-Swift.h:1003:12: warning: parameter 'delegate' not found in the function declaration [-Wdocumentation]
/// \param delegate A listener object that will receive events from this view.
           ^~~~~~~~
12 warnings generated.

To Reproduce
Steps to reproduce the behavior:

  1. Import KlarnaMobileSDK
  2. See warnings (-Wdocumentation) that cannot be suppressed

Expected behavior
There are no mistakes that cause warnings.

Screenshots

A screenshot of Xcode warnings

Device and version:

  • Device: -
  • OS version: -
  • Klarna In-App SDK version 2.1.5

Merchant Name
Joom

Impact Level
These are the only warnings in our project. We need to keep the project free of warnings to get new [important] warnings noticed immediately.

Additional context
The SDK is integrated via Carthage.

Provide error enumeration instead of strings for error handling

Is your feature request related to a problem? Please describe.
As part of the Flows & Errors Handling documentation: https://developers.klarna.com/documentation/in-app/overview/inapp-sdk-flows/ you provide a list of cases which should be handled by the developer such as Rejected Authorize or Invalid Client Token. In that documentation:

func klarnaFailed(inPaymentView paymentView: KlarnaPaymentView, withError error: KlarnaPaymentError) {
        if error.name == "InvalidClientTokenError" {
          // Client token used to initialize the SDK is invalid.
           // Merchant should get a valid client token and use it to initialize the SDK again.
        }
    }

In the callback klarnaFailed you provide as parameter an instance of KlarnaPaymentError which contains a couple of attributes: action and message. Those properties have to be checked in order to detect the kind of error, but since they are Strings we don't have a list of the errors that could be returned by the SDK.

Describe the solution you'd like
Defining an enum the kind of error would let us to keep a clear code to handle those errors. For example, following your documentation, the error.name ShowFormFalseError is being used for multiple errors depending on the action (Load, Authorize, etc.).

Current status:

func klarnaFailed(inPaymentView paymentView: KlarnaPaymentView, withError error: KlarnaPaymentError) {
        if error.action == "Authorize" && error.name == "ShowFormFalseError" {
           // user is rejected when authorizing the payment.
           // Merchant should remove the Klarna view and stop the payment process.
        } else if error.action == "Load" && error.name = "ShowFormFalseError" {
          // The selected payment method is invalid.
           // Merchant should set a valid payment method for SDK and initialize the SDK again.
        }
    }

Our proposal:

func klarnaFailed(inPaymentView paymentView: KlarnaPaymentView, withError error: KlarnaPaymentError) {
   switch(error.type) {
      case .invalidPaymentMethod:
         // The selected payment method is invalid.
         // Merchant should set a valid payment method for SDK and initialize the SDK again.
      case .rejectedAuthorization:
        // user is rejected when authorizing the payment.
        // Merchant should remove the Klarna view and stop the payment process.
   }
}

Actually comparing Strings is not so secure solution because in case any developer or even you as SDK provider has any typo, the error handling will fail.

Describe alternatives you've considered
At least provide a list of possible values for both action and name properties.

Additional context
N/A

Payment fails if app has a non-alphanumeric name

Describe the bug
The SDK infers the merchant name using the app's name. However, if the app's name contains a non-alphanumeric name (such as special characters or emojis), starting the SDK fails.

To Reproduce
Steps to reproduce the behavior:

  1. Name your app something like "Klarnaβ"
  2. Start the SDK to attempt a payment
  3. Receive the error

Expected behavior
The SDK should either:

  • Escape all non-supported characters on its end, as it's querying the app's name using NSBundle APIs
  • Add an API to pass the merchant name programmatically and not infer it using NSBundle APIs

Screenshots
Screenshot 2022-07-28 at 13 04 12

Device and version:

  • Device: Any iOS Device
  • OS version: Any iOS Version
  • Klarna In-App SDK version 2.2.0

Merchant Name
NaturitasES

Impact Level
Can't proceed with integration

Additional context
None

Infinite loading after rejection

Describe the bug
I'm working on integrating Klarna payments into native iOS app and I encounter some problems.
I'd like to test a scenario where the user selects deferred payment and is not authorized. It doesn't work as I expect (but sometimes does)

I use sample customer data for the client from Germany and provide this phone number: +49017610927312.

To Reproduce
Steps to reproduce the behavior:

  1. Initialize PaymentView with "pay_later" category.
  2. Provide given phone number (+49017610927312)
  3. Click on 'Bestätingungscode senden'
  4. Provide SMS code (123456)
  5. Click on 'Bestätingen'
  6. See infinite loader on PaymentView

Expected behavior

  1. Initialize PaymentView with "pay_later" category.
  2. Provide given phone number (+49017610927312)
  3. Click on 'Bestätingungscode senden'
  4. Provide SMS code (123456)
  5. Click on 'Bestätingen'
  6. See info about error
  7. Click on 'Schließen'
  8. Get notified about error by delegate method

Screenshots
1
2
3
4

Invalid flow:
5a

Correct flow:
5b

Device and version:

  • Device: iPhone 12 mini and iOS Simulators
  • OS version: iOS 16.4
  • Klarna In-App SDK version 2.6.1

Merchant Name
modivo.sa

Impact Level
Blocking release

Swift Compiler Warning: arm64-apple-ios.swiftsourceinfo is either malformed or generated by a different Swift version

Describe the bug
After updating to Xcode 13.0 the line:
import KlarnaMobileSDK
Triggers Swift Compiler Warning with the following message:
" ... Pods/KlarnaMobileSDK/ios/full/xcode-12.3-fat/KlarnaMobileSDK.framework/Modules/KlarnaMobileSDK.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo' is either malformed or generated by a different Swift version. Note that it uses an unstable format and may leak internal project details, it should not be distributed alongside modules"

To Reproduce
Steps to reproduce the behavior:

  1. Install version 2.0.44 of KlarnaMobileSDK
  2. Update Xcode to version 13.0
  3. Open project in Xcode
  4. Run the app
  5. The warning then occurs in Issue navigator under Buildtime tab.

Expected behavior
Running the app should not trigger a Swift Complier Warning.

Screenshots
N/A

Device and version:

  • Device: iPhone 12 Pro
  • OS version: 14.4.1
  • Klarna In-App SDK version: 2.0.44
  • Xcode version: 13.0

Merchant Name
I'd rather not state this here unless absolutely necessary.

Impact Level
The full impact has not yet been determined but so far the app still compiles and runs OK in Xcode

Additional context
Noted that no Swift Compiler Warning was triggered when using Xcode version 12.4. Combined with the fact "xcode-12.3" is mentioned in the path in the warning message, I'm guessing that "generated by a different Swift version" is probably the cause.

My app still compiles and runs OK on an iPhone 12 Pro so probably not a critical issue. But "unstable format and may leak internal project details, it should not be distributed alongside modules" does not sound good for a release on App Store.

Crash in AssetManager.kt

Describe the bug
Users experiencing crashes with the Klarna In-App SDK when trying to render KlarnaOSMView

To Reproduce
Unable to reproduce. From stacktraces it occurs when trying to render KlarnaOSMView.

Expected behavior
Fatal Exception: java.lang.StackOverflowError: stack size 1043KB
at com.klarna.mobile.sdk.a.i.a.a.b.getAnalyticsManager(AssetManager.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.d.a$a.a(a.java:1)
at com.klarna.mobile.sdk.a.i.a.d.b.getAnalyticsManager(ConfigParser.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.a.b.getAnalyticsManager(AssetManager.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.d.a$a.a(a.java:1)
at com.klarna.mobile.sdk.a.i.a.d.b.getAnalyticsManager(ConfigParser.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.a.b.getAnalyticsManager(AssetManager.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.d.a$a.a(a.java:1)
at com.klarna.mobile.sdk.a.i.a.d.b.getAnalyticsManager(ConfigParser.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.a.b.getAnalyticsManager(AssetManager.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.d.a$a.a(a.java:1)
at com.klarna.mobile.sdk.a.i.a.d.b.getAnalyticsManager(ConfigParser.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.a.b.getAnalyticsManager(AssetManager.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.d.a$a.a(a.java:1)
at com.klarna.mobile.sdk.a.i.a.d.b.getAnalyticsManager(ConfigParser.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.a.b.getAnalyticsManager(AssetManager.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.d.a$a.a(a.java:1)
at com.klarna.mobile.sdk.a.i.a.d.b.getAnalyticsManager(ConfigParser.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.a.b.getAnalyticsManager(AssetManager.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.d.a$a.a(a.java:1)
at com.klarna.mobile.sdk.a.i.a.d.b.getAnalyticsManager(ConfigParser.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.a.b.getAnalyticsManager(AssetManager.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.d.a$a.a(a.java:1)
at com.klarna.mobile.sdk.a.i.a.d.b.getAnalyticsManager(ConfigParser.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.a.b.getAnalyticsManager(AssetManager.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.d.a$a.a(a.java:1)
at com.klarna.mobile.sdk.a.i.a.d.b.getAnalyticsManager(ConfigParser.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.a.b.getAnalyticsManager(AssetManager.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.d.a$a.a(a.java:1)
at com.klarna.mobile.sdk.a.i.a.d.b.getAnalyticsManager(ConfigParser.kt:1)
at com.klarna.mobile.sdk.a.g.c$a.a(SdkComponent.kt:1)
at com.klarna.mobile.sdk.a.i.a.a.b.getAnalyticsManager(AssetManager.kt:1)
at com.klarna.mobile.sdk.a.g.e.a(e.java:4)
at com.klarna.mobile.sdk.a.g.e.a(e.java:1)
at com.klarna.mobile.sdk.a.i.a.a.e.c(RemoteAssetManager.kt:4)
at com.klarna.mobile.sdk.a.i.a.a.e.a(RemoteAssetManager.kt:2)
at com.klarna.mobile.sdk.a.i.a.a.e$b.a(RemoteAssetManager.kt:37)
at com.klarna.mobile.sdk.a.i.a.a.e$b.invoke(RemoteAssetManager.kt:1)
at com.klarna.mobile.sdk.a.i.a.a.e$e.invokeSuspend(RemoteAssetManager.kt:31)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

Device and version:

  • Device: Mi Note 10 Lite, Galaxy Z Flip3, Zenfone 6, POCO X3, Redmi Note 9 Pro
  • OS version: Android 11, Android 10
  • Klarna In-App SDK version - 2.1.3

Merchant Name
Vestiaire Collective

Impact Level
App crashes while user is browsing a Product. Very high impact.

Additional context
about 12 crashes since the rollout of the feature.

Cannot install via Carthage

I am trying to install the Klarna Mobile SDK for iOS with Carthage.

I have added github "klarna/klarna-mobile-sdk" to the Cartfile.

When I run carthage update klarna-mobile-sdk I get: *** Skipped building klarna-mobile-sdk due to the error: Dependency "klarna-mobile-sdk" has no shared framework schemes

Am I doing something wrong?

EDIT: As a workaround I was able to use binary "https://raw.githubusercontent.com/klarna/klarna-mobile-sdk/master/KlarnaMobileSDK.xcode-11.5-fat.json" in the Cartfile instead. This seems to successfully install the SDK.

Xcode 14.0 Swift 5.7 compilation error

Describe the bug
Package fails to compile with current Xcode Version 14.0 (14A309) with Swift 5.7 run on macOS Monterey 12.6
Compiler points out two errors:

Failed to build module 'KlarnaMobileSDK'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.5.1 (swiftlang-1300.0.31.4 clang-1300.0.29.6)', while this compiler is 'Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50)'). Please select a toolchain which matches the SDK.

@objc public protocol KlarnaStandaloneWebViewDelegate : ObjectiveC.NSObject - Inheritance from non-protocol type 'NSObject'

To Reproduce
Steps to reproduce the behavior:

  1. Start new Xcode project on Xcode 14 with Swift 5.7 toolchain
  2. Add klarna-mobile-sdk package
  3. import KlarnaMobileSDK anywhere in the project
  4. see error

Expected behavior
Project compiles on current Xcode version.

Screenshots
Screenshot 2022-09-26 at 13 53 48
Screenshot 2022-09-26 at 14 00 06

Device and version:

  • Device: Any iOS Device, Xcode run on macOS Monterey 12.6
  • OS version: Any iOS Version
  • Klarna In-App SDK version 2.2.0, 2.3.0

Merchant Name
Dashl

Impact Level
Issue blocking development

Additional context
Reproduced on another macOS with same Xcode version, as well as Xcode 14.1 beta 2.
Also no longer working on Xcode version 13.1 (with toolchain for Swift 5.5.1), displaying different error message.
Screenshot 2022-09-26 at 16 01 50

[Android] Documentation for Custom Tab and One Klarna payment flow.

Is your feature request related to a problem? Please describe.

In Android 2.1.7 Release in Changelog, I can see
"Added support for opening Custom Tabs". and

in the 2.1.6 Release, I can see
"Added support for "One Klarna" payment flow."

But In the Documentation, I don't find How we can use it in Android App?

Describe the solution you'd like
Please share if any documentation is available for Custom Tab and "One Klarna Payment Flow". So we can open Klarna Payment Flow in Custom Tab instead of Webview and we can implement this in our Android App. If not then please update the Documentation.

Currently, If Webview is not installed on Device then KlarnaOSMView is not opening in Webview. As a fallback, we can open this in Custom Tab?

Describe alternatives you've considered
Also, I feel we can update this in Demo App. In Demo App, I have don't find the Implementation of One Klarna payment flow and opening Custom Tab. If possible please also update Demo App also.

Merchant Name
I'd rather not state this here unless absolutely necessary.

Screenshots

Screenshot from 2022-06-09 18-01-03

Device and version

Device: All
OS version: All
Klarna In-App SDK version 2.1.8

Additional context
Google is not recommended Embedded login using the web view and also Blocks OAuth Requests Made Via Embedded Browsers.
So If for Payment Flow Custom Tab Functionality is available then for security purpose, we want to switch to a custom tab instead of Webview.

https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html
https://developers.facebook.com/docs/facebook-login/android/deprecating-webviews

Android Sdk

I have consulted your customer service, and the customer service advice is not to implement it through Android sdk, is this true

How can I get BGProdKlarnaView height?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

I set translatesAutoresizingMaskIntoConstraints = NO, I can not get BGProdKlarnaView height after data loading.

I put BGProdKlarnaView into tableview cell ,so I need to know to height of it.

Can not use KlarnaOSMViewEventListener either OC or Swift

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Device and version:

  • Device: [e.g. iPhone6]
  • OS version: [e.g. iOS8.1]
  • Klarna In-App SDK version [e.g. 1.2.3]

Merchant Name
Please state the merchant's name and the application's name that is facing the issue using the SDK.

Impact Level
What is the impact level of this bug on the merchant and its customers? Is it happening in production? Is it a blocking issue for development? etc.

Additional context
Add any other context about the problem here.

sdk version:2.0.43

My project was base on OC, and I want to show KlarnaOSMView in my view. I want to get dynamic height by KlarnaOSMViewEventListener, but in oc, there is no delegate in KlarnaOSMView.

WeChat2fc66743c414dc6929310c514695bc47

WeChatbd94ef4bfffc4a995d2e4b64aca4d403

So I try swift, but shows error by KlarnaOSMViewEventListener.

WeChat03872c7516cddc8aecd724f7e77a398c
urgent.

What can I do? it's

Deprecated API Usage - UIWebView

Hello! After uploading the app to App Store Connect I got a message from the team stating:
We identified one or more issues with a recent delivery for your app, (...) ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . After running a grep searching for UIWebView, KlarnaMobileSDK was the only result to appear.

To Reproduce

  1. Add KlarnaMobileSDK to your app.
  2. Upload the app to App Store Connect.

Additional context
As I've seen in the issues for the Checkout SDK (klarna/kco-mobile-sdk#34) you probably are aware of the problem, however there is already an upload deadline for apps that use UIWebView (https://developer.apple.com/news/?id=12232019b):

The App Store will no longer accept new apps using UIWebView as of April 2020 and app updates using UIWebView as of December 2020.

iOS app rejected due to ITMS-90683: Missing Purpose String for NSCameraUsageDescription despite using KlarnaMobileSDK/basic

Describe the bug
The iOS app I'm working on gets rejected due to ITMS-90683: Missing Purpose String for NSCameraUsageDescription despite using KlarnaMobileSDK/basic. I thought the basic version did not include the card scanning feature and therefore did not require the NSCameraUsageDescription?

To Reproduce
Steps to reproduce the behavior:

  1. Add pod 'KlarnaMobileSDK/basic','2.1.6' to podfile
  2. Run pod install
  3. Archive and upload app to AppStoreConnect
  4. After a while I receive an email from AppStoreConnect:
    "Dear Developer,
    We identified one or more issues with a recent delivery for your app. Please correct the following issues, then upload again.

ITMS-90683: Missing Purpose String in Info.plist - Your app‘s code references one or more APIs that access sensitive user data. The app‘s Info.plist file should contain a NSCameraUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. For details, visit: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources

Best regards,
The App Store Team"

Expected behavior
The app should upload to AppStoreConnect without having to specify the NSCameraUsageDescription in the info.plist

Screenshots
N/A

Device and version:

  • Device: N/A
  • OS version: N/A
  • Klarna In-App SDK version: 2.1.6 (basic)

Merchant Name

Impact Level
Prevents release which is required to update the KlarnaMobileSDK in the app.

Additional context
N/A

Android - issue related to KlarnaPaymentView and Android Compose

Describe the bug
Klarna SDK does not update selected category when adding to Compose

To Reproduce
Steps to reproduce the behavior:

  1. Select klarna category
  2. Initialize a widget in Compose -> AndroidView using factory and update functions
  3. Open klarna view (correct category)
  4. Close klarna view
  5. Select different klarna category
  6. Open klarna view (previous category is still selected)

10:25:48.727 V Init + pay_later
10:25:48.883 V klarna factory pay_later
10:25:48.884 V klarna update: pay_later

10:25:49.448 V Init + pay_later

10:25:56.264 V Init + pay_later
10:25:56.716 V Init + pay_later
10:25:56.775 V Init + pay_later
10:25:59.262 V Init + pay_later

10:26:01.499 V Init + pay_later
10:26:01.580 V klarna factory pay_later
10:26:01.581 V klarna update: pay_later

10:26:02.027 V Init + pay_later
10:26:30.931 V Init + pay_later
10:26:31.978 V Init + pay_now
10:26:31.993 V klarna update: pay_later

10:26:32.431 V Init + pay_now
10:26:35.415 V Init + pay_now
10:26:35.864 V Init + pay_now
10:26:35.891 V Init + pay_now
10:26:37.313 V Init + pay_now
10:26:38.562 V Init + pay_now
10:26:38.572 V klarna update: pay_later

10:26:38.994 V Init + pay_now
10:26:40.395 V Init + pay_now
10:26:40.833 V Init + pay_now
10:26:40.859 V Init + pay_now
10:26:41.325 V Init + pay_now

10:26:43.127 V Init + pay_now
10:26:43.188 V klarna factory pay_now
10:26:43.189 V klarna update: pay_now
10:26:46.292 V Init + pay_now
10:26:47.243 V Init + pay_now
10:26:47.271 V klarna update: pay_now

10:26:47.713 V Init + pay_now
Init in remember function
klarna update in AndroidView#Update
klarna factory in AndroidView#Factory

Triggered steps from logs:

Expected behavior
Kategory in Klarna SDK should change, alternatively Klarna widget in compose

Screenshots
https://drive.google.com/file/d/1tWLF3Sndk67gHTiyECTHZapCVvmyTFoW/view?usp=sharing

Device and version:

  • Klarna In-App SDK version 2.6.1

Merchant Name
modivo.sa

Impact Level
Mid

Additional context
Is there a chance to add additional method - isInitilized?

No klarna-inapp-sdk tag on Stack Overflow

Describe the bug
The tag "klarna-inapp-sdk" mentioned under "Support" does not exist on Stack Overflow and I do not have enough reputation points to create it.

Since I'm not sure if my problem is an error on my part or a bug in the SDK I want to be able to label it correctly so the right people see it and I suspect that you're keeping an eye on that tag?

Could you create the tag so that I can add it?

Link to my problem/question on Stack Overflow: https://stackoverflow.com/questions/61461478/klarnahybridsdk-getting-swamped-with-the-message-notifying-native-hook-andr

To Reproduce
Steps to reproduce the behavior:

  1. Create a new question on Stack Overflow
  2. Add the tag "klarna-inapp-sdk"
  3. Click on Submit
  4. Here I get an error telling me that the tag does not exist and that I need at least 1500 reputation points to be able to create a new tag. See link to screenshot below.

Expected behavior
Be able to add the tag "klarna-inapp-sdk" to my question on Stack Overflow

Screenshots
https://postimg.cc/4HzsV4zj

Device and version:
N/A

Additional context
N/A

Support arm64 simulator in .xcframework and SPM package

Is your feature request related to a problem? Please describe.

The .xcframework does not support the arm64 iOS Simulator (the simulator on M1 Macs).

As we eventually get M1 Macs for our developers, without fixing this, they won't be able to build and run our app on the simulator.

Describe the solution you'd like

Build the .xcframwork with an arm64 iOS simulator slice.
A correct .xcframework, supporting the arm64 simulator, would contain Info.plist entries as follows:

<dict>
	<key>DebugSymbolsPath</key>
	<string>dSYMs</string>
	<key>LibraryIdentifier</key>
	<string>ios-arm64_i386_x86_64-simulator</string> <==========
	<key>LibraryPath</key>
	<string>KlarnaMobileSDK.framework</string>
	<key>SupportedArchitectures</key>
	<array>
	        <string>arm64</string>      <============
		<string>i386</string>
		<string>x86_64</string>
	</array>
	<key>SupportedPlatform</key>
	<string>ios</string>
	<key>SupportedPlatformVariant</key>
	<string>simulator</string>
</dict>

Compare to: https://github.com/klarna/klarna-mobile-sdk/blob/master/ios/XCFramework/full/universal/KlarnaMobileSDK.xcframework/Info.plist

Can not show Staging View after using 2.0.44 version SDK

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Device and version:

  • Device: [e.g. iPhone6]
  • OS version: [e.g. iOS8.1]
  • Klarna In-App SDK version 2.0.44

Merchant Name
Please state the merchant's name and the application's name that is facing the issue using the SDK.

Impact Level
What is the impact level of this bug on the merchant and its customers? Is it happening in production? Is it a blocking issue for development? etc.

Additional context

After using 2.0.44 version SDK, the tap action of the KlarnaOSMView was disable. Which
means it can not show the Staging view.
And I tried many times figured out the KlarnaOSMView only respond the small area in the picture.

WeChatd88f540cd9c6c1481e3f45eaffa7dd18

LICENSE file is missing but still specified in podspec

Describe the bug
My company uses the cocoapods-acknowledgements plugin. After pod update to 2.0.30, I see this warning:

[!] Unable to read the license file `LICENSE` for the spec `KlarnaMobileSDK (2.0.30)`

The podspec still specifies a LICENSE file, but the file appears to have been deleted sometime after 2.0.28.

To Reproduce
Steps to reproduce the behavior:

  1. pod update KlarnaMobileSDK

Expected behavior
LICENSE file should be available. Or license section in podspec should be removed or fixed.

KlarnaHybridEventListener functions not triggered

Describe the bug
The problem:

  • KlarnaHybridEventListener functions are no longer triggered.
  • I rely on those functions to hide my tab-bar so that I can display the Klarna popup registration form properly.

What I did before the problem occurred:

  1. Updated to version 2.0.9 from 2.0.8 to resolve one of your previous issues: #12
  2. Updated my implementation to use KlarnaHybridEventListener instead of the (according to xCode) deprecated KlarnaHybridSDKEventListener with the help of the integration guides:

To Reproduce
Steps to reproduce the behavior:

  1. Add: pod “KlarnaMobileSDK”, “>=2.0.9” to the Podfile
  2. run pod install
  3. Add something similar to the following code:
import KlarnaMobileSDK
class MyClass : KlarnaHybridEventListener {

    var klarnaSDK:KlarnaHybridSDK! 
    var myWebView : WKWebView!

    
    override func viewDidLoad() {
        super.viewDidLoad()
	//Set up webview
	myWebView = WKWebView(frame: self.view.frame, configuration: config)
        KlarnaMobileSDKCommon.setLoggingLevel(.verbose)
        klarnaSDK = KlarnaHybridSDK(returnUrl: URL(string: “myapp://“)!, eventListener: self )
        klarnaSDK.addWebView(self.myWebView)

	...
   }

    func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
        klarnaSDK?.newPageLoad(in: logicWebView)
    }
    
    func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
        if klarnaSDK.shouldFollowNavigation(withRequest: navigationAction.request) != true {
            decisionHandler(.cancel)
        } else {
	    decisionHandler(.allow)
    	}
   }

Note regarding the last bit of code below: Not the same as in the integration guide (https://developers.klarna.com/documentation/in-app/ios/steps-hybrid/#more-about-the-klarna-hybrid-sdk-listener) since xCode did not think that code "conformed to protocol ‘KlarnaHybridEventListener’". Instead I was forced to use the stubs below suggested by xCode. Could this be a possible cause for the issue?!

    func klarnaWillShowFullscreen(inWebView webView: KlarnaWebView, completionHandler: @escaping () -> Void) {
        print("klarnaWillShowFullscreen")
    }
    
    func klarnaDidShowFullscreen(inWebView webView: KlarnaWebView, completionHandler: @escaping () -> Void) {
        print("klarnaDidShowFullscreen")
    }
    
    func klarnaWillHideFullscreen(inWebView webView: KlarnaWebView, completionHandler: @escaping () -> Void) {
        print("klarnaWillHideFullscreen")
    }
    
    func klarnaDidHideFullscreen(inWebView webView: KlarnaWebView, completionHandler: @escaping () -> Void) {
        print("klarnaDidHideFullscreen")
    }
    
    func klarnaFailed(inWebView webView: KlarnaWebView, withError error: KlarnaMobileSDKError) {
        print("klarnaFailed")
    }
}

Expected behavior
The KlarnaHybridEventListener functions should be triggered when the Klarna popup form takes over in fullscreen mode and when the fullscreen mode is exited.

Device and version:

  • Device: iPhone 7
  • OS version: iOS 13.3
  • XCode version: 11.3.1
  • Klarna In-App SDK version: 2.0.9

I can't release my app to App Store with issue #12 so reverting to 2.0.8 is not an option. Please advice.

KlarnaPaymentView is not loading klarna payment screen in android

I am using KlarnaPaymentView for my android project
It is not loading klarna payment screen in physical devices
But in emulator it is working fine
Previously it was working in physical devices as well
Klarna library that I am using : 'com.klarna.mobile:sdk:2.0.16'

Code for klarna:
private void initViews() {
mPaymentView = findViewById(R.id.paymentView);
mPaymentView.setCategory("pay_over_time");
mProceed = findViewById(R.id.button_proceed);
mPaymentView.registerPaymentViewCallback(mCallback);
mPaymentView.initialize(klarnaSessionResponse.getClientToken(), "https://vendiapp.com");
mProceed.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View view) {
mPaymentView.authorize(true, null);
}
});
}

private KlarnaPaymentViewCallback mCallback = new KlarnaPaymentViewCallback() {
    @Override
    public void onInitialized(@NotNull KlarnaPaymentView klarnaPaymentView) {
        klarnaPaymentView.load(null);
    }

    @Override
    public void onLoaded(@NotNull KlarnaPaymentView klarnaPaymentView) {
        paymentInProcessView.setVisibility(View.GONE);
        mPaymentView.setVisibility(View.VISIBLE);
        mProceed.setVisibility(View.VISIBLE);
        getSupportActionBar().show();
    }

    @Override
    public void onLoadPaymentReview(@NotNull KlarnaPaymentView klarnaPaymentView, boolean b) {
        LogUtils.d("values on authorized",
                "onLoadPaymentReview");
    }

    @Override
    public void onAuthorized(@NotNull KlarnaPaymentView klarnaPaymentView, boolean approved,
            @Nullable String authToken, @Nullable Boolean finalizedRequired) {
        LogUtils.d("values on authorized",
                " " + approved + " " + authToken + " " + finalizedRequired);
        if (authToken != null) {
            setupKlarnaBuyViewModel(new KlarnaAuthToken(authToken));
            // authorization is successful, backend may create order
        }
    }

    @Override
    public void onReauthorized(@NotNull KlarnaPaymentView klarnaPaymentView, boolean approved,
            @Nullable String authToken) {
        LogUtils.d("values on authorized",
                "onReauthorized");
    }

    @Override
    public void onFinalized(@NotNull KlarnaPaymentView klarnaPaymentView, boolean approved,
            @Nullable String authToken) {
        LogUtils.d("values on authorized",
                "onFinalized");
    }

    @Override
    public void onErrorOccurred(@NotNull KlarnaPaymentView klarnaPaymentView,
            @NotNull KlarnaPaymentsSDKError klarnaPaymentsSDKError) {
        LogUtils.d("values on authorized",
                "onErrorOccurred " + klarnaPaymentsSDKError.getMessage());
        startPaymentFailureActivity(getString(R.string.payment_failed_with_klarna));
    }
};

when first init payment view, always "option not available"

Describe the bug
A clear and concise description of what the bug is.

image
when I first request clientToken and initialize the paymentview,sometimes it tells me option not available -.-

onInitialized and onErrorOccurred will be called ..

the same order,try again maybe is fine...

LOG is “ShowFormFalseError”

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Device and version:

  • Device: [e.g. iPhone6]
  • OS version: [e.g. Android 11]
  • Klarna In-App SDK version [2.1.8]

Merchant Name
Please state the merchant's name and the application's name that is facing the issue using the SDK.

Impact Level
What is the impact level of this bug on the merchant and its customers? Is it happening in production? Is it a blocking issue for development? etc.

Additional context
Add any other context about the problem here.

I/chromium: [INFO:CONSOLE(10)] "Error performing Klarna.Payments.load(). ShowFormFalseError: Show form set to false.", source: file:///data/user/0/com.xxxx.android/files/kp_index.html?mockkp=true&storeall=true&loglevel=0&endpoint=aws (10)
I/chromium: [INFO:CONSOLE(10)] "Sending message:
{
"action": "actionToNative",
"sender": "KlarnaPaymentsWrapper",
"receiver": "Native",
"params": {
"actionType": "errorResponse",
"error": "ShowFormFalseError",
"message": "Error performing Klarna.Payments.load().",
"isPublic": "true",
"isFatal": "true",
"action": "Load"
},
"messageId": "esQJCp2FvV"
}", source: file:///data/user/0/com.xxxx.android/files/kp_index.html?mockkp=true&storeall=true&loglevel=0&endpoint=aws (10)
D/PurchaseKlarnaActivity: Klarna onErrorOccurred...
KlarnaPaymentsSDKError(name=ShowFormFalseError, message=Error performing Klarna.Payments.load()., isFatal=true, action=Load, invalidFields=null)
I/chromium: [INFO:CONSOLE(10)] "New dimensions found: [object ResizeObserverEntry]", source: file:///data/user/0/com.xxxx.android/files/kp_index.html?mockkp=true&storeall=true&loglevel=0&endpoint=aws (10)
I/chromium: [INFO:CONSOLE(10)] "Sending message:
{
"action": "heightChanged",
"sender": "KlarnaPaymentsWrapper",
"receiver": "Native",
"params": {
"height": "123.265625"
},
"messageId": "f4mlIRztz7"
}", source: file:///data/user/0/com.xxxx.android/files/kp_index.html?mockkp=true&storeall=true&loglevel=0&endpoint=aws (10)
I/chromium: [INFO:CONSOLE(10)] "Container size changed", source: file:///data/user/0/com.xxxx.android/files/kp_index.html?mockkp=true&storeall=true&loglevel=0&endpoint=aws (10)

A server with the specified hostname could not be found

Describe the bug
viewing the loogs It seems that some request are launched with invalid host name. it has not the // after https:

https:evt.klarna.com/v1/mobile-sdk/klarna-mobile-sdk/paymentsResponse.

To Reproduce
Steps to reproduce the behavior:

  1. just follow
    https://developers.klarna.com/documentation/in-app/ios/steps-klarna-payments-native/
  2. Watch logs
    Expected behavior
    Klarna payments view loaded.

Screenshots

The last logs thrown by klarna SDK
[NetworkService] Error: Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={NSUnderlyingError=0x60000028a220 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}}, NSErrorFailingURLStringKey=https://evt.klarna.com/v1/mobile-sdk/klarna-mobile-sdk/paymentsResponse, NSErrorFailingURLKey=https://evt.klarna.com/v1/mobile-sdk/klarna-mobile-sdk/paymentsResponse, _kCFStreamErrorDomainKey=12, _kCFStreamErrorCodeKey=8, NSLocalizedDescription=A server with the specified hostname could not be found.} in result for request: https:evt.klarna.com/v1/mobile-sdk/klarna-mobile-sdk/paymentsResponse.
[NetworkService] NetworkService handleError called with no completion.

Device and version:

  • Device: [e.g. iPhone11 pro]
  • OS version: [e.g. iOS13.4]
  • Klarna In-App SDK version [pod 'KlarnaMobileSDK', '2.0.12' ]

iOS App will not build on Xcode 11.3 with KlarnaMobileSDK imported

Hi! The app I'm currently developing will not build with KlarnaMobileSDK imported with the following error:
Module compiled with Swift 5.1 cannot be imported by the Swift 5.1.3 compiler: (...)/Pods/KlarnaMobileSDK/ios/xcode-swift51-fat/KlarnaMobileSDK.framework/Modules/KlarnaMobileSDK.swiftmodule/x86_64-apple-ios-simulator.swiftmodule

Steps to reproduce the behavior:

  1. Add pod 'KlarnaMobileSDK/xcode-swift51-fat', '~> 2.0.8' to the pod file
  2. Add import KlarnaMobileSDK in any of the Swift files
  3. Build

Expected behavior
The whole workspace is expected to build successfully.

Device and version:

  • Xcode 11.3
  • Swift 5.1.3 compiler

Additional context
Supposedly adding:
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
to project file ensures module stability needed for the binary to be properly imported within the app.

Builds using 2.0.44 rejected by Apple due to issue ITMS-90683

Describe the bug

Since upgrading to 2.0.44, builds of our app are rejected by Apple under requirement ITMS-90683.

Full details from Apple's emails:

ITMS-90683: Missing Purpose String in Info.plist - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSCameraUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data are required to include a purpose string. If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

To Reproduce

Submit build of new app to Apple using the Klarna Mobile SDK v2.0.44.

Expected behavior

I would expect Klarna to document that the NSCameraUsageDescription key is required to use this version of the SDK, as well as documentation for why the SDK needs camera access, and example usage description strings for apps to use for this.

Screenshots

Not applicable.

Merchant Name

Merchant: H&M
Application: Sorted by H&M

Impact Level

We can work around this by downgrading to an earlier version.

Additional context

Looking at the git diff of the latest release, it looks like Klarna has added the ability to scan a card (based on nib name), and this could potentially be using the camera. As the framework is closed source we are unable to confirm this as the use, or the only usage. We could come up with some copy for this, but as we don't know for sure we'd prefer to use a string recommended by the SDK, or based on SDK documentation.

error: virtual filesystem overlay file not found

Hi 👋

We use the SDK on our app and we're getting errors in the lldb that points paths with your usernames.
This is blocking us to use the lldb to properly debug our app. We can't even do a simple po command.

error: virtual filesystem overlay file '/Users/carlos.jimenez/Library/Developer/Xcode/DerivedData/KlarnaMobileSDK-bfjfbshljhpqyrbnhsmaiszqmfat/Build/Intermediates.noindex/KlarnaMobileSDK.build/Release-iphonesimulator/KlarnaMobileSDK.build/all-product-headers.yaml' not found
error: couldn't IRGen expression. Please check the above error messages for possible root causes.

I've found this old issue which is now closed:
#7
Is it related? Was this fixed already?

Registration of card as payment method stuck at "Waiting for authentication"

Describe the bug
The registration of a card as payment method gets stuck after successfully authenticating with BankID and returning to the app from external browser (which opened this page https://cards-eu.klarna.com/gui/modern-13.1.0//pay-challenger.html?init3ds=…) In the app the Klarna popup shows “Väntar på autentisering” (Waiting for authentication) and a loading animation (which is moving) but it never goes away. However if I press the “X” and close the Klarna popup the process recovers and the card gets successfully registered.

To Reproduce
Steps to reproduce the behavior:

  1. Start the Klarna registration process
  2. Choose card as payment method
  3. Fill in all the information
  4. Click on “Betala” (Pay)
  5. Wait for redirect to external browser and for to load https://cards-eu.klarna.com/gui/modern-13.1.0//pay-challenger.html?init3ds=…
  6. Manually open the BankID app and sign
  7. Manually open the external browser again
  8. Click on “Slutför betalning”
  9. Wait for automatic redirect back to my app
  10. The Klarna popup is now showing “Väntar på autentisering” (Waiting for authentication) and loading animation
  11. Then you get stuck here indefinitely
    1. Or until closing the Klarna popup and then somehow triggering the success of the registration process

Expected behavior
The Klarna popup will show “Väntar på autentisering” (Waiting for authentication) and loading animation for a short period of time. After the registration is successful the Klarna popup will close automatically and the app can continue.

Screenshots
https://i.postimg.cc/MGgy3vYm/IMG-2937.png

Device and version:

  • Device:
    • iPhone 12 Pro
    • Samsung Galaxy A10
  • OS version:
    • iOS 14.4.1
    • Android 10
  • Klarna In-App SDK version:
    • iOS: 2.1.6
    • Android: 2.1.7

Merchant Name
Kalmar länstrafik, GoOn

Impact Level
High. It’s blocking the required update to 2.1.6 and 2.1.7 for iOS and Android respectively. This update needs to be done by this week because of Klarnas deadline (15/7) for update being placed in the middle of Swedish summer vacations.

Additional context

  • The app uses the klarnaHybridSDK.
  • This issue did not occur in previous implementations using Klarna In-App SDK version 2.0.23 for iOS and 2.0.16 for Android. Unfortunately these are long jumps in versions and therefore I cannot confirm if the issues started with 2.1.6/2.1.7 or earlier.

Found crash issue when clicking on hyperlink text( ex. Terms & Condition)

--------- beginning of crash

2020-10-17 20:41:47.064 8525-8525/com.wrinkleit.ecommerce.android.local E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.wrinkleit.ecommerce.android.local, PID: 8525
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wrinkleit.ecommerce.android.local/com.klarna.mobile.sdk.core.natives.browser.ui.InternalBrowserActivity}: android.view.InflateException: Binary XML file line #80 in com.wrinkleit.ecommerce.android.local:layout/activity_internal_browser: Binary XML file line #80 in com.wrinkleit.ecommerce.android.local:layout/activity_internal_browser: Error inflating class com.klarna.mobile.sdk.core.natives.browser.ui.TintableImageView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: android.view.InflateException: Binary XML file line #80 in com.wrinkleit.ecommerce.android.local:layout/activity_internal_browser: Binary XML file line #80 in com.wrinkleit.ecommerce.android.local:layout/activity_internal_browser: Error inflating class com.klarna.mobile.sdk.core.natives.browser.ui.TintableImageView
Caused by: android.view.InflateException: Binary XML file line #80 in com.wrinkleit.ecommerce.android.local:layout/activity_internal_browser: Error inflating class com.klarna.mobile.sdk.core.natives.browser.ui.TintableImageView
Caused by: java.lang.ClassNotFoundException: com.klarna.mobile.sdk.core.natives.browser.ui.TintableImageView
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:454)
at android.view.LayoutInflater.createView(LayoutInflater.java:815)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:438)
at android.app.Activity.setContentView(Activity.java:3324)
at com.klarna.mobile.sdk.core.natives.browser.ui.InternalBrowserActivity.onCreate(InternalBrowserActivity.kt:4)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
2020-10-17 20:41:47.074 8525-8525/com.wrinkleit.ecommerce.android.local E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.ClassNotFoundException: com.klarna.mobile.sdk.core.natives.browser.ui.TintableImageView
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 30 more
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/appcompat/widget/AppCompatImageView;
... 30 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.appcompat.widget.AppCompatImageView" on path: DexPathList[[zip file "/data/app/com.wrinkleit.ecommerce.android.local-EUcwhuxXXNl6S5rZ3fhPaw==/base.apk"],nativeLibraryDirectories=[/data/app/com.wrinkleit.ecommerce.android.local-EUcwhuxXXNl6S5rZ3fhPaw==/lib/x86, /system/lib, /system/product/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 30 more

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.