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

Infinite loading when calling BTClient.showPaymentViewController #105

Open
unpokolokko opened this issue Oct 18, 2018 · 2 comments
Open

Comments

@unpokolokko
Copy link

unpokolokko commented Oct 18, 2018

Everytime my app user choose Braintree as payment options i will call to setup the BTClient based on platform(ios/android) , see code below :

//setup BTClient

if (Platform.OS === "ios") {
      BTClient.setupWithURLScheme(token, "com.abc.abc");
    } else {
      BTClient.setup(token);
    }
}

And then I call over :

BTClient.showPaymentViewController({
        bgColor: "#FFF",
        tintColor: "#ff6600",
        barBgColor: "#0066cc",
        barTintColor: "white"

}) .then(function(nonce) {
   //do something here

}).catch(function(err){

//do something here

}

But what happened is, it just showing loading page and seemed to stuck there.

screen shot 2018-10-18 at 2 15 08 pm

This never happens before and only happens in certain Android phones.Works fine in certain Android phone. I checked in iOS , seemed like this problem didn't occur in iOS.

"react-native": "^0.49.0",
"react-native-braintree-xplat": "^4.0.0",

Thanks.

@unpokolokko unpokolokko changed the title Infinite loops when calling PaymentViewController Infinite loading when calling BTClient.showPaymentViewController Oct 18, 2018
@HassanRaza03
Copy link

any solution..?

@unpokolokko
Copy link
Author

I think it might be caused by setup process is not yet complete before showpaymentviewcontroller is being called.

u need to make sure setup is first completed.

this is my workaround :

if (Platform.OS === "ios") {
      BTClient.setupWithURLScheme(token, "com.abc.abc");
    } else {
      await BTClient.setup(token);
    }
}

then :

 setTimeout(() => {
     BTClient.showPaymentViewController({
        bgColor: "#FFF",
        tintColor: "#ff6600",
        barBgColor: "#0066cc",
        barTintColor: "white"
  }) .then(function(nonce) {
        //do something here
  }).catch(function(err){
        //do something here
  });
}, 3000);

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