klarna / react-native-klarna-inapp-sdk Goto Github PK
View Code? Open in Web Editor NEWKlarna's React Native wrapper for the In-App SDK
License: Apache License 2.0
Klarna's React Native wrapper for the In-App SDK
License: Apache License 2.0
when we try to include the SDK into Klarna application that uses package com.klarna
we have a DEX conflict.
All modules/libraries should use own unique package name.
P.S. Its ok for the rest of the world, but for internal use we create conflict.
P.P.S. workaround:
android {
/* ... */
/* Custom source code injection */
sourceSets {
// http://google.github.io/android-gradle-dsl/current/com.android.build.gradle.api.AndroidSourceSet.html
main {
/*
Inject library source code into solution to prevent the conflict of
the packages: App - com.klarna & InAppSdk - com.klarna
*/
java.srcDirs project(':react-native-klarna-inapp-sdk').file('src/main/java')
}
}
}
recommended package name: com.klarna.inapp.sdk
OR com.klarna.inapp
Describe the bug
This issue occurred in android, after session initialised, the app rendered three payment options:
When the user click "1) Bankkonto", KlarnaPaymentView#onLoaded was triggered, but the webview won't render. 2) and 3) work as expected only if when the user hasn't clicked 1) previously.
To Reproduce
Steps to reproduce the behavior (scenario 1):
Steps to reproduce the behavior (scenario 2):
Logs from android studio
client url and credentials are masked by "xxxxxxxxxxxxxxxxxxx".
I/chromium: [INFO:CONSOLE(0)] "Uncaught (in promise) TypeError: Failed to fetch", source: file:///data/user/0/xxxxxxxxxxxxxxxxxxxxxx/files/kp_index.html?mockkp=true&storeall=true&loglevel=0 (0)
[INFO:CONSOLE(11)] "Received message:
{
"action": "actionToComponent",
"messageId": "7302ce5",
"params": {
"actionType": "initialize",
"clientToken": "xxxxxxxxxxxxxx_client_token_xxxxxxxxxxxxxx",
"returnUrl": "https://www.xxxxxxxxxxxxxxxxxxx.se/klarna-success-return"
},
"receiver": "KlarnaPaymentsWrapper",
"sender": "Native"
}", source: file:///data/user/0/xxxxxxxxxxxxxxxxxxxxxxxxx/files/kp_index.html?mockkp=true&storeall=true&loglevel=0 (11)
[INFO:CONSOLE(11)] "Sending event: RecvdInitialize", source: file:///data/user/0/xxxxxxxxxxxxxxxxxxxxxx/files/kp_index.html?mockkp=true&storeall=true&loglevel=0 (11)
[INFO:CONSOLE(11)] "Handling mock init.", source: file:///data/user/0/xxxxxxxxxxxxxxxxxxxxxx/files/kp_index.html?mockkp=true&storeall=true&loglevel=0 (11)
I/chromium: [INFO:CONSOLE(11)] "Token parsed: true", source: file:///data/user/0/xxxxxxxxxxxxxxxxxxxxxx/files/kp_index.html?mockkp=true&storeall=true&loglevel=0 (11)
I/chromium: [INFO:CONSOLE(11)] "Sending event: ValidatedInitialize", source: file:///data/user/0/xxxxxxxxxxxxxxxxxxxxxx/files/kp_index.html?mockkp=true&storeall=true&loglevel=0 (11)
I/chromium: [INFO:CONSOLE(11)] "Performing Klarna.Payments.init().", source: file:///data/user/0/xxxxxxxxxxxxxxxxxxxxxx/files/kp_index.html?mockkp=true&storeall=true&loglevel=0 (11)
[INFO:CONSOLE(11)] "Sending event: PerformingInitialize", source: file:///data/user/0/xxxxxxxxxxxxxxxxxxxxxx/files/kp_index.html?mockkp=true&storeall=true&loglevel=0 (11)
W/WebView: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 2) {5db60d0} called on Looper (JavaBridge, tid 1446) {39cb602}, FYI main Looper is Looper (main, tid 2) {5db60d0})
at android.webkit.WebView.checkThread(WebView.java:2575)
at android.webkit.WebView.getUrl(WebView.java:1251)
at com.klarna.mobile.sdk.a.e.m.g.<init>(AnalyticBuilder.kt:2)
at com.klarna.mobile.sdk.a.e.m.b.a(AnalyticBuilder.kt:1)
at com.klarna.mobile.sdk.a.e.m.a.a(AnalyticBuilder.kt:4)
at com.klarna.mobile.sdk.a.e.m.a.a(AnalyticBuilder.kt:12)
at com.klarna.mobile.sdk.core.webview.g$a.postMessage(WebViewNativeHook.kt:36)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:336)
at android.os.Looper.loop(Looper.java:174)
at android.os.HandlerThread.run(HandlerThread.java:67)
D/StrictMode: StrictMode policy violation: android.os.strictmode.WebViewMethodCalledOnWrongThreadViolation
at android.webkit.WebView.checkThread(WebView.java:2575)
at android.webkit.WebView.getUrl(WebView.java:1251)
at com.klarna.mobile.sdk.a.e.m.g.<init>(AnalyticBuilder.kt:2)
at com.klarna.mobile.sdk.a.e.m.b.a(AnalyticBuilder.kt:1)
at com.klarna.mobile.sdk.a.e.m.a.a(AnalyticBuilder.kt:4)
at com.klarna.mobile.sdk.a.e.m.a.a(AnalyticBuilder.kt:12)
at com.klarna.mobile.sdk.core.webview.g$a.postMessage(WebViewNativeHook.kt:36)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:336)
at android.os.Looper.loop(Looper.java:174)
at android.os.HandlerThread.run(HandlerThread.java:67)
W/System.err: java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 2) {5db60d0} called on Looper (JavaBridge, tid 1446) {39cb602}, FYI main Looper is Looper (main, tid 2) {5db60d0})
at android.webkit.WebView.checkThread(WebView.java:2580)
at android.webkit.WebView.getUrl(WebView.java:1251)
at com.klarna.mobile.sdk.a.e.m.g.<init>(AnalyticBuilder.kt:2)
at com.klarna.mobile.sdk.a.e.m.b.a(AnalyticBuilder.kt:1)
at com.klarna.mobile.sdk.a.e.m.a.a(AnalyticBuilder.kt:4)
at com.klarna.mobile.sdk.a.e.m.a.a(AnalyticBuilder.kt:12)
at com.klarna.mobile.sdk.core.webview.g$a.postMessage(WebViewNativeHook.kt:36)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:336)
at android.os.Looper.loop(Looper.java:174)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 2) {5db60d0} called on Looper (JavaBridge, tid 1446) {39cb602}, FYI main Looper is Looper (main, tid 2) {5db60d0})
at android.webkit.WebView.checkThread(WebView.java:2575)
... 10 more
Device and version:
Additional context
In 2.0.5, webview won't render, but in 2.0.2, it will crash the app;
It works perfectly in iOS.
pod 'KlarnaMobileSDK'
"react-native-klarna-inapp-sdk": "^1.0.3"
Libraries and binary linked
After a freshnpm i
and pod install with react-native link.
Getting /source/app/node_modules/react-native-klarna-inapp-sdk/ios/view/PaymentViewWrapper.m:10:9: 'KlarnaMobileSDK/KlarnaMobileSDK-Swift.h' file not found
Could not find a declaration file for module 'react-native-klarna-inapp-sdk'. '/Users/deva/Desktop/delete_me/AwesomeApp/node_modules/react-native-klarna-inapp-sdk/src/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/react-native-klarna-inapp-sdk
if it exists or add a new declaration (.d.ts) file containing declare module 'react-native-klarna-inapp-sdk';
ts(7016)
To Reproduce
Steps to reproduce the behavior:
Describe the bug
When user is selecting payment terms its showing PERMISSION_DENIED error
Expected behavior
It should show
{
"order_id": "3eaeb557-5e30-47f8-b840-b8d987f5945d",
"redirect_url": "https://payments.klarna.com/redirect/...",
"fraud_status": "ACCEPTED",
"authorized_payment_method": "invoice"
}
Screenshots
If applicable, add screenshots to help explain your problem.
Device and version:
Merchant Name
The Fragrance Shop
Impact Level
not able to go live with the app
I installed the plugin by following the instructions on the README page. However, the compilation failed while running react-native run-android
. The errors occurred for Task :react-native-klarna-inapp-sdk:compileDebugJavaWithJavac
. The error messages are attached below.
RN Version: "0.59.5",
react-native-klarna-inapp-sdk
Version: "1.0.0"
Error messages:
> Task :react-native-klarna-inapp-sdk:compileDebugJavaWithJavac FAILED
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-kl
arna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.jav
a:14: error: package com.klarna.mobile.sdk.api.payments does not exist
import com.klarna.mobile.sdk.api.payments.KlarnaPaymentView;
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-kl
arna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.jav
a:15: error: package com.klarna.mobile.sdk.api.payments does not exist
import com.klarna.mobile.sdk.api.payments.KlarnaPaymentViewCallback;
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-kl
arna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:16: error: package com.klarna.mobile.sdk.api.payments does not exist
import com.klarna.mobile.sdk.api.payments.KlarnaPaymentsSDKError;
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:30: error: cannot find symbol
public class KlarnaPaymentViewManager extends SimpleViewManager<PaymentViewWrapper> implements KlarnaPaymentViewCallback {
^
symbol: class KlarnaPaymentViewCallback
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/PaymentViewWrapper.java:13: error: package com.klarna.mobile.sdk.api.payments does not exist
import com.klarna.mobile.sdk.api.payments.KlarnaPaymentView;
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:188: error: cannot find symbol
private void postEventForView(String eventName, Map additionalParams, KlarnaPaymentView view) {
^
symbol: class KlarnaPaymentView
location: class KlarnaPaymentViewManager
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:205: error: cannot find symbol
public void onInitialized(@NotNull KlarnaPaymentView paymentView) {
^
symbol: class KlarnaPaymentView
location: class KlarnaPaymentViewManager
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:210: error: cannot find symbol
public void onLoaded(@NotNull KlarnaPaymentView paymentView) {
^
symbol: class KlarnaPaymentView
location: class KlarnaPaymentViewManager
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:215: error: cannot find symbol
public void onLoadPaymentReview(@NotNull KlarnaPaymentView paymentView, boolean b) {
^
symbol: class KlarnaPaymentView
location: class KlarnaPaymentViewManager
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:220: error: cannot find symbol
public void onAuthorized(@NotNull KlarnaPaymentView paymentView, boolean approved, @org.jetbrains.annotations.Nullable String authToken, @org.jetbrains.annotations.Nullable Boolean finalizeRequired) {
^
symbol: class KlarnaPaymentView
location: class KlarnaPaymentViewManager
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:230: error: cannot find symbol
public void onReauthorized(@NotNull KlarnaPaymentView paymentView, boolean approved, @org.jetbrains.annotations.Nullable String authToken) {
^
symbol: class KlarnaPaymentView
location: class KlarnaPaymentViewManager
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:239: error: cannot find symbol
public void onFinalized(@NotNull KlarnaPaymentView paymentView, boolean approved, @org.jetbrains.annotations.Nullable String authToken) {
^
symbol: class KlarnaPaymentView
location: class KlarnaPaymentViewManager
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:248: error: cannot find symbol
public void onErrorOccurred(@NotNull KlarnaPaymentView klarnaPaymentView, @NotNull KlarnaPaymentsSDKError klarnaPaymentsSDKError) {
^
symbol: class KlarnaPaymentView
location: class KlarnaPaymentViewManager
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:248: error: cannot find symbol
public void onErrorOccurred(@NotNull KlarnaPaymentView klarnaPaymentView, @NotNull KlarnaPaymentsSDKError klarnaPaymentsSDKError) {
^
symbol: class KlarnaPaymentsSDKError
location: class KlarnaPaymentViewManager
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:252: error: cannot find symbol
private PaymentViewWrapper wrapperForPaymentView(KlarnaPaymentView paymentView) {
^
symbol: class KlarnaPaymentView
location: class KlarnaPaymentViewManager
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/PaymentViewWrapper.java:21: error: cannot find symbol
public KlarnaPaymentView paymentView;
^
symbol: class KlarnaPaymentView
location: class PaymentViewWrapper
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:125: error: variable sessionData is already defined in method receiveCommand(PaymentViewWrapper,int,ReadableArray)
final String sessionData = args.getString(1);
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:132: error: variable sessionData is already defined in method receiveCommand(PaymentViewWrapper,int,ReadableArray)
String sessionData = null;
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:141: error: variable sessionData is already defined in method receiveCommand(PaymentViewWrapper,int,ReadableArray)
String sessionData = null;
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:161: error: cannot find symbol
KlarnaPaymentEvent.EVENT_NAME_ON_INITIALIZE, MapBuilder.of("registrationName", KlarnaPaymentEvent.EVENT_NAME_ON_INITIALIZE),
^
symbol: variable EVENT_NAME_ON_INITIALIZE
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:161: error: cannot find symbol
KlarnaPaymentEvent.EVENT_NAME_ON_INITIALIZE, MapBuilder.of("registrationName", KlarnaPaymentEvent.EVENT_NAME_ON_INITIALIZE),
^
symbol: variable EVENT_NAME_ON_INITIALIZE
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:162: error: cannot find symbol
KlarnaPaymentEvent.EVENT_NAME_ON_LOAD, MapBuilder.of("registrationName", KlarnaPaymentEvent.EVENT_NAME_ON_LOAD),
^
symbol: variable EVENT_NAME_ON_LOAD
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:162: error: cannot find symbol
KlarnaPaymentEvent.EVENT_NAME_ON_LOAD, MapBuilder.of("registrationName", KlarnaPaymentEvent.EVENT_NAME_ON_LOAD),
^
symbol: variable EVENT_NAME_ON_LOAD
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:163: error: cannot find symbol
KlarnaPaymentEvent.EVENT_NAME_ON_LOAD_PAYMENT_REVIEW, MapBuilder.of("registrationName", KlarnaPaymentEvent.EVENT_NAME_ON_LOAD_PAYMENT_REVIEW),
^
symbol: variable EVENT_NAME_ON_LOAD_PAYMENT_REVIEW
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:163: error: cannot find symbol
KlarnaPaymentEvent.EVENT_NAME_ON_LOAD_PAYMENT_REVIEW, MapBuilder.of("registrationName", KlarnaPaymentEvent.EVENT_NAME_ON_LOAD_PAYMENT_REVIEW),
^
symbol: variable EVENT_NAME_ON_LOAD_PAYMENT_REVIEW
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:164: error: cannot find symbol
KlarnaPaymentEvent.EVENT_NAME_ON_AUTHORIZE, MapBuilder.of("registrationName", KlarnaPaymentEvent.EVENT_NAME_ON_AUTHORIZE),
^
symbol: variable EVENT_NAME_ON_AUTHORIZE
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:164: error: cannot find symbol
KlarnaPaymentEvent.EVENT_NAME_ON_AUTHORIZE, MapBuilder.of("registrationName", KlarnaPaymentEvent.EVENT_NAME_ON_AUTHORIZE),
^
symbol: variable EVENT_NAME_ON_AUTHORIZE
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:165: error: cannot find symbol
KlarnaPaymentEvent.EVENT_NAME_ON_REAUTHORIZE, MapBuilder.of("registrationName", KlarnaPaymentEvent.EVENT_NAME_ON_REAUTHORIZE),
^
symbol: variable EVENT_NAME_ON_REAUTHORIZE
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:165: error: cannot find symbol
KlarnaPaymentEvent.EVENT_NAME_ON_REAUTHORIZE, MapBuilder.of("registrationName", KlarnaPaymentEvent.EVENT_NAME_ON_REAUTHORIZE),
^
symbol: variable EVENT_NAME_ON_REAUTHORIZE
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:166: error: cannot find symbol
KlarnaPaymentEvent.EVENT_NAME_ON_FINALIZE, MapBuilder.of("registrationName", KlarnaPaymentEvent.EVENT_NAME_ON_FINALIZE)
^
symbol: variable EVENT_NAME_ON_FINALIZE
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:166: error: cannot find symbol
KlarnaPaymentEvent.EVENT_NAME_ON_FINALIZE, MapBuilder.of("registrationName", KlarnaPaymentEvent.EVENT_NAME_ON_FINALIZE)
^
symbol: variable EVENT_NAME_ON_FINALIZE
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:204: error: method does not override or implement a method from a supertype
@Override
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:206: error: cannot find symbol
postEventForView(KlarnaPaymentEvent.EVENT_NAME_ON_INITIALIZE, null, paymentView);
^
symbol: variable EVENT_NAME_ON_INITIALIZE
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:209: error: method does not override or implement a method from a supertype
@Override
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:211: error: cannot find symbol
postEventForView(KlarnaPaymentEvent.EVENT_NAME_ON_LOAD, null, paymentView);
^
symbol: variable EVENT_NAME_ON_LOAD
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:214: error: method does not override or implement a method from a supertype
@Override
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:216: error: cannot find symbol
postEventForView(KlarnaPaymentEvent.EVENT_NAME_ON_LOAD_PAYMENT_REVIEW, null, paymentView);
^
symbol: variable EVENT_NAME_ON_LOAD_PAYMENT_REVIEW
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:219: error: method does not override or implement a method from a supertype
@Override
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:221: error: cannot find symbol
postEventForView(KlarnaPaymentEvent.EVENT_NAME_ON_AUTHORIZE,
^
symbol: variable EVENT_NAME_ON_AUTHORIZE
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:229: error: method does not override or implement a method from a supertype
@Override
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:231: error: cannot find symbol
postEventForView(KlarnaPaymentEvent.EVENT_NAME_ON_REAUTHORIZE,
^
symbol: variable EVENT_NAME_ON_REAUTHORIZE
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:238: error: method does not override or implement a method from a supertype
@Override
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:240: error: cannot find symbol
postEventForView(KlarnaPaymentEvent.EVENT_NAME_ON_FINALIZE,
^
symbol: variable EVENT_NAME_ON_FINALIZE
location: class KlarnaPaymentEvent
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java:247: error: method does not override or implement a method from a supertype
@Override
^
/Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/PaymentViewWrapper.java:31: error: cannot find symbol
paymentView = new KlarnaPaymentView(getReactAppContext().getCurrentActivity(), attrs); // Insure we use activity and not application context for dialogs.
^
symbol: class KlarnaPaymentView
location: class PaymentViewWrapper
Note: /Users/ying.zhang/Projects/hxxxx/cs_xxxx/node_modules/react-native-klarna-inapp-sdk/android/src/main/java/com/klarna/KlarnaPaymentViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
45 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-klarna-inapp-sdk:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
Will you have any plan to upgrade to support new React Native fabric renderer system ?
https://reactnative.dev/docs/next/new-architecture-intro
Describe the bug
After integrating the react native sdk when I am compiling the app on iOS simulator I am getting error : "Command PhaseScriptExecution failed with a nonzero exit code".
This is happening on latest version '2.0.42'. But I am able to run the code on sdk version '2.0.24' and below that. So not sure why this is happening on latest versions.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
App should run on iOS simulator.
Device and version:
Additional context
I have also tested the iOS demo app which is also giving the same error. Link: https://github.com/klarna/kp-ios-example-app
Describe the bug
No API calls starting with HTTP (http://203.89.289/api/get) are working in Android, but API calls starting with HTTPS (https://domain.com/api/get) are working. No issue in iOS.
To Reproduce
Steps to reproduce the behaviour:
API calls starting with HTTP are not working at all after installing this package. Even though I got this error from rn-fetch-blob, none of the APIs is working.
Expected behaviour
All the API calls starting with HTTP needs to work in Android.
Device and version:
Is your feature request related to a problem? Please describe.
From what I see on the following doc https://docs.klarna.com/in-app/inapp-android-overview/on-site-messaging/
On-site messaging is currently only available on KLARNA iOS and android SDK, meaning that if we want to integrate it on a React Native app, we will need to create a bridge.
Describe the solution you'd like
Ideally, it would be nice if On-site Messaging was directly available in React Native SDK and not have to bridge based on the native(android and ios) SDKs.
Describe alternatives you've considered
Build a bridge based on iOS and Android KLARNA SDK.
Additional context
We are integrating with stripe, but we think this part(On-site Messaging) need to be implemented directly from KLARNA SDK. Correct me if I'm wrong.
Thank you
Describe the bug
On Android, some part of the content is not rendered, this text is missing:
You must be 18+ to use this credit card. ....
Expected behavior
All data should be visible
Screenshots
Device and version:
Additional context
On iOS everything is ok. The screenshot is above.
When I try to load the authorization window it animates up and stays for a split second, then dissapears completely. This is on iOS 13.1 running on different simulators. Have not had the possibility to test it on an actual device though. I also tried it with v1.0.2 and v1.0.3 with no luck.
Hi,
Android soft keyboard hides the input field at bottom of screen and the content above the keyboard is not scrollable.
This makes a bad user experience since the users needs to write their info in blindfold (behind the soft keyboard).
This can be fixed by setting android:windowSoftInputMode="adjustResize" in Manifest.xml but that will change the behaviour on the soft keyboard in the whole app, which is not wanted in this case. It is only needed in the Klarna module.
Device and version:
Samsung S20 FE Android 11
On Android , if you try to render KlarnaPaymentView for category pay_over_time , the Webview is not fully rendered , It just shows the header part with breakdown of payments, without the Card Input View where user would enter their card details .
It seems like it has to do with Height listener in Android , because if you rotate your device and then bring it back , it layouts fine , the same code works fine for IOS .
A clear and concise description of what the bug is.
To Reproduce
some of the code is removed , but skeleton is there .
Steps to reproduce the behavior:
`
import { KlarnaConfirmationFooter } from './klarna-confirmation-footer.component';
export const StyledKlarnaPaymentView = styled(KlarnaPaymentView)width: 100%; flex: 1;
;
export const KlarnaWebViewWrapper = styled.Viewflex: 1;
;
export const KlarnaConfirmationWrapper = styled.Viewflex: 1;
;
export const KlarnaConfirmation: React.FC = React.memo(function KlarnaConfirmation() {
return (
<KlarnaConfirmationWrapper>
<KlarnaWebViewWrapper>
{!isKlarnaLoaded && <ActivityIndicator size="large" />}
{!isFetching && (
<StyledKlarnaPaymentView
category={chosenCategory as string}
ref={klarnaViewRef}
onInitialized={handleInitialised}
onLoaded={handleLoaded}
onAuthorized={eventCallBack}
onError={eventCallBack}
onFinalized={eventCallBack}
onReauthorized={eventCallBack}
/>
)}
</KlarnaWebViewWrapper>
<KlarnaConfirmationFooter disabled={isFooterButtonDisabled} onPress={handlePayWithKlarnaTap} />
</KlarnaConfirmationWrapper>
);
});
`
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem. This is from a physical Huwaei p30 lite
Device and version:
Huwaei P30 lite
Android Version 10.0
SDK Version 2.0.13
Galaxy J5
Android Version 7.1.1
SDK Version 2.0.13
Additional context
Describe the bug
After I authorize braintree 's 3D Secure 2, i can't open the klarna's authorize popup in reactnative app for ios.
I find KlarnaPaymentView's authorize method and callback was be called, code execution is normal,but I can't see the authorize popup.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
how to fix it, or tell me what happend
Device and version:
Impact Level
Is it a blocking issue for development.
Describe the bug
Running pod install
after SDK installation gives error
Fetching podspec for `react-native-klarna-inapp-sdk` from `../node_modules/react-native-klarna-inapp-sdk/react-native-klarna-inapp-sdk.podspec`
Downloading dependencies
Installing KlarnaMobileSDK (2.0.10)
Installing react-native-klarna-inapp-sdk (1.0.9)
[!] Error installing react-native-klarna-inapp-sdk
[!] /usr/bin/git clone https://github.com/klarna/react-native-klarna-inapp-sdk.git /var/folders/w2/hgd452qx5qv8jvq0r1k1fxv40000gn/T/d20200227-7880-p7tvpp --template= --single-branch --depth 1 --branch 1.0.9
Cloning into '/var/folders/w2/hgd452qx5qv8jvq0r1k1fxv40000gn/T/d20200227-7880-p7tvpp'...
warning: Could not find remote branch 1.0.9 to clone.
fatal: Remote branch 1.0.9 not found in upstream origin
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should install without errors
Device and version:
Additional context
We did not have issues with 1.0.7
Describe the bug
Gradle build fails while executing command npm run android
on React Native
To Reproduce
Steps to reproduce the behavior:
npx react-native init ProjectName
npm install react-native-klarna-inapp-sdk --save
react-native link react-native-klarna-inapp-sdk
Expected behavior
App build succeeds
Device and version:
Additionally, if i remove klarna from dependencies, it would without any problems.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.klarna.mobile:sdk:2.0.16.
Searched in the following locations:
- file:/Users/ios/.m2/repository/com/klarna/mobile/sdk/2.0.16/sdk-2.0.16.pom
- file:/Users/ios/Desktop/demo_tests/paymentDemo/node_modules/react-native/android/com/klarna/mobile/sdk/2.0.16/sdk-2.0.16.pom
- file:/Users/ios/Desktop/demo_tests/paymentDemo/node_modules/jsc-android/dist/com/klarna/mobile/sdk/2.0.16/sdk-2.0.16.pom
- https://dl.google.com/dl/android/maven2/com/klarna/mobile/sdk/2.0.16/sdk-2.0.16.pom
- https://jcenter.bintray.com/com/klarna/mobile/sdk/2.0.16/sdk-2.0.16.pom
- https://www.jitpack.io/com/klarna/mobile/sdk/2.0.16/sdk-2.0.16.pom
Required by:
project :app > project :react-native-klarna-inapp-sdk
I fix this error by following this https://github.com/klarna/react-native-klarna-inapp-sdk#warning-regarding-android-integration
But after that metro server does not run. Project Builds successfully but metro server do not run .
I followed this guide and fixed metro issue too but it is just a hack and it breaks hot refresh and debugging .
Expected behavior
It should run with metro server .
Here is the example code you can check it also for reproducing same error:- https://github.com/EndLess728/klarna-demo-
Device and version:
I'm not able to run the app on iOS simulator any more but it's seems to be working fine on physical device.
dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from: .../Frameworks/KlarnaMobileSDK.framework/KlarnaMobileSDK Reason: no suitable image found. Did find: /usr/lib/swift/libswiftCore.dylib: mach-o, but not built for iOS simulator
What should I do to make it run on simulator?
When the application is first installed, KlarnaPaymentView is rendered as it's supposed to be. but if the app is refreshed (like codepush update or metro reload)
option description text fields ( like pay_later) are not showing.
This is the ss from when the first time your test app is installed:
this is ss after the reload app with metro (r key press)
test device
1- android 13 s22 ultra
2- android 12 m31
"dependencies": { "@react-navigation/native": "^6.0.12", "@react-navigation/native-stack": "^6.8.0", "react": "17.0.1", "react-native": "0.64.4", "react-native-klarna-inapp-sdk": "file:../", "react-native-safe-area-context": "^3.4.1", "react-native-screens": "^3.17.0" },
Describe the bug
I cannot say if it is a bug, but when I am integrating react-native-klarna-inapp-sdk
into my project, and running ./gradlew assembleRelease
, it is failing with the following error. Refer to the screenshot.
To Reproduce
Steps to reproduce the behavior:
Screenshots
Impact Level
It is kind of urgent and blocking me from finishing my Android build.
Describe the bug
Unable to run the project on android in the latest react native version (0.71.4)
To Reproduce
Updated react native version from 0.66.5 to 0.71.4 and unable to run the project in android.
Device and version:
Thanks
Describe the bug
On Android the app can't connect to Metro Bundler in the development mode. I've also tried to run your test project, but the situation is the same.
If I remove Klarna - everything is okay.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Android app can connect to metro bundler.
Device and version:
Impact Level
I've tried it on three projects, including yours and template one. Same with my colleague. It could be a blocker if the problem is global.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.