Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android - issue related to KlarnaPaymentView and Android Compose #194

Open
AndroidDeveloperEob opened this issue May 30, 2023 · 4 comments

Comments

@AndroidDeveloperEob
Copy link

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?

@NMGuner
Copy link
Member

NMGuner commented Jun 1, 2023

Hi, unfortunately KlarnaPaymentView as of today does not support changing the category thus it logs an error and ignores the new value. We have allowing changing the category in the roadmap with no exact date. That means the only option right now is to create a new view if the category is changed.

We will try to priotize this for better compose support but can't promise if it will happen soon enough.

Is there a chance to add additional method - isInitilized?
I guess you would require this for reusing the view again, is that right?

@AndroidDeveloperEob
Copy link
Author

Hello, thx, for briefing. I get the idea but I would like to not create new Views and recompose. Did you try and reproduce using your widget in Android Compose or did other merchant have similar issue? Or could there be a chance with an issue related to destroying existing KlarnaPaymentView?

Is there a chance to add additional method - isInitilized?
I guess you would require this for reusing the view again, is that right?
I could try and create new view when AndroidView#Update was called but only if all Data was correctly initialized and category is different than current from the flow.

@AndroidDeveloperEob
Copy link
Author

Up

@AndroidDeveloperEob
Copy link
Author

@NMGuner any news on this topic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants