GithubHelp home page GithubHelp logo

Comments (7)

omarbh avatar omarbh commented on May 31, 2024 1

Hi @zpengyu, we will look into this and get back to you as soon as possible.

from react-native-klarna-inapp-sdk.

NMGuner avatar NMGuner commented on May 31, 2024 1

@zpengyu Thanks for the information.

The logs you see are actually coming from the native Klarna In-App SDK hence the GuardedRunnable in the plugin implementation is not the cause of the problem. Those logs are apparently happening due to logging implementation inside our native SDK and will be looked upon.

On my tries I observed that the logs from native sdk does not crash the react native app(they are caught) and the render on WebView did not have any problems, so I tried to manually trigger something similar from a new Thread that I created and that crashed the app with an Exception. I do think that such exception from logging errors wouldn't cause WebView not to render especially if caught but it might crash the app.

As a solution we will look into the issue inside the Klarna In-App SDK and provide a fix for the Thread used on such logs to prevent any errors or logs that might occur. After that fix is released it will be carried over to the React Native SDK as well.

from react-native-klarna-inapp-sdk.

NMGuner avatar NMGuner commented on May 31, 2024

Hi @zpengyu, I am looking into this issue and I can see the same logs you posted when running. Those are internal issues which will be looked upon on a future release. As for the issue of not rendering a WebView or a crash I was unable to recreate the problem, I tried 2.0.2 and 2.0.5 versions as you mentioned. Can you provide us the stacktrace of those two cases? I may be able to recreate or understand the problem from those logs.

from react-native-klarna-inapp-sdk.

zpengyu avatar zpengyu commented on May 31, 2024

Hi @NMGuner Thanks for the reply!

Here're some updates about the issue we have:

  • Both 2.0.2 and 2.0.5 output the same log, the only difference is 2.0.5 won't crash the app, I think after upgrading KlarnaMobileSDK to 2.0.15, the app won't crash.
  • All three payment options have the same issue, they stopped rendering

The stacktrace is basically the same I pasted in my previous comment, and it complained java.lang.Throwable: A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread.

It seems like the GuardedRunnable is deprecated in PaymentViewWrapper.java could this be the case that cause the problem?

from react-native-klarna-inapp-sdk.

pontus1 avatar pontus1 commented on May 31, 2024

As the KlarnaPaymentView triggers requestLayout() the value from "document.body.scrollHeight" is sometimes "null" (thus returning) or "0" setting scaledHeight to 0

from react-native-klarna-inapp-sdk.

zpengyu avatar zpengyu commented on May 31, 2024

We semi-solved this issue from our side by patching the file PaymentViewWrapper.java

The issue occasionally occurred during rendering the web view of pay via bank account. This web view wouldn't get rendered because the height value cannot be set correctly. Usually the height got updated twice, the first one is 0, the second one is the real value. However, the height value of bankkonto can be updated only once which is always 0, due to the rendering process has been halted for unknown reasons, probably multi threading issue in react native or some illegal characters inside the web content. We can only reach this far and hard to dig deeper.

To solve (or semi-solve) the issue, we gave the height a default value, for example 500, instead of zero from the web view. So the web view will always displayed even though it's not fully rendered. This has been tested many times, one out of three the web view of bank account won't rendered correctly, but at least we can display content what we have.

PaymentViewWrapper.java    L78
if(value == null || value.equals("null") || value.equals("undefined")){
    return;
}
+ if(value.equals("0")) {
+     value = "500";
+ }

The screenshot below is an example of web view not being fully rendered.

Screenshot 2020-06-16 at 13 40 22

So imho, one direction is to investigate the web content of bankkonto. For example, checking some analytics code, strange characters or error handling promises.

from react-native-klarna-inapp-sdk.

zpengyu avatar zpengyu commented on May 31, 2024

This issue has been solved in v2.0.9, thanks a lot for the help!

from react-native-klarna-inapp-sdk.

Related Issues (20)

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.