Closed hideokamoto closed 2 years ago
Thanks. Capacitor Plugin's method must be Promise base. so I think is**Available
should be resolve/reject .
I had the same thoughts @hideokamoto, but I understand @rdlabo. However here is a some sugar code I use to getting a boolean on a call:
function boolifyPromise(promise) {
return promise.then(() => true).catch(() => false);
}
//
const isApplePayAvailable = await boolifyPromise(Stripe.isApplePayAvailable());
if (!isApplePayAvailable) {
return null;
}
I think these methods should return
boolean
. And we can use the returned attributes to change the UI behavior.Can we replace these behavior?