mkloubert / nativescript-paypal

PayPal plugin for NativeScript
MIT License
8 stars 5 forks source link

WindowManager: at com.tns.Runtime.callJSMethodNative(Native Method) #3

Closed jibon57 closed 7 years ago

jibon57 commented 7 years ago

Hi,

Thanks for the plugin. I am getting following error:

07-18 10:56:57.277  4751  4751 E WindowManager:         at com.tns.Runtime.callJSMethodNative(Native Method)
07-18 10:56:57.277  4751  4751 E WindowManager:         at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1021)
07-18 10:56:57.277  4751  4751 E WindowManager:         at com.tns.Runtime.callJSMethodImpl(Runtime.java:903)
07-18 10:56:57.277  4751  4751 E WindowManager:         at com.tns.Runtime.callJSMethod(Runtime.java:890)
07-18 10:56:57.277  4751  4751 E WindowManager:         at com.tns.Runtime.callJSMethod(Runtime.java:874)
07-18 10:56:57.277  4751  4751 E WindowManager:         at com.tns.Runtime.callJSMethod(Runtime.java:866)

for this code:

switch (cbResult.code) {
          case 0:
            // SUCCESS
            // pay key is stored in 'cbResult.key'
              TNSFancyAlert.showSuccess("Order Confirmed", msg, "OK")
            })
            break;

          case 1:
            TNSFancyAlert.showError("Error", "Operation was CANCELLED' are required !", "Close");
            // operation was CANCELLED
            break;

          case -1:
            // checkout FAILED
            TNSFancyAlert.showError("Error", "Checkout FAILED' are required !", "Close");
            break;

          case -2:
            // "unhandled exception"
            TNSFancyAlert.showError("Error", "Unhandled exception' are required !", "Close");
            break;
        }

I am using {N} 3. In where I am doing wrong? I can get result by console.log but when I am trying to call a method, it's showing that error.

jibon57 commented 7 years ago

Better to wait using setTimeout() few milliseconds