Open unpokolokko opened 5 years ago
any solution..?
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);
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
And then I call over :
But what happened is, it just showing loading page and seemed to stuck there.
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.