#IvonneVargas

1 messages ยท Page 1 of 1 (latest)

burnt belfryBOT
acoustic spindle
#

Hello! Can you show me what your code looks like?

cunning nymph
#

Hi, I'm using it in the componentDidMount:

#

async componentDidMount() {
let isApplePaySupported = await isPlatformPaySupported();
console.log("isApplePaySupported: " + isApplePaySupported);
this.setState({isApplePaySupported: isApplePaySupported})
}

acoustic spindle
#

And you're getting no logs from that at all? Did you also put a long line before calling isPlatformPaySupported() just to make sure that code is being hit?

cunning nymph
#

Yes, I put a console before calling isPlatformPaySupported and if it appears...

#

like this

#

async componentDidMount() {
console.log("componentDidMount");
let isApplePaySupported = await isPlatformPaySupported();
console.log("isApplePaySupported: " + isApplePaySupported);
this.setState({isApplePaySupported: isApplePaySupported})
}

acoustic spindle
#

๐Ÿ‘ okay good, just wanted to be sure

#

so I assume you're seeing the "componentDidMount" log but nothing for "isApplePaySupported: "?

#

Are you seeing anything in your ios logs?

cunning nymph
#

nothing... only the console

#

and other things...

#

I'm importing it like this ... import { StripeProvider, CardField, confirmPayment, PlatformPayButton, isPlatformPaySupported } from '@stripe/stripe-react-native';

acoustic spindle
#

Hmmm... are you testing with a real device, or the emulator?

#

and do you konw which version of our react native sdk you're using?

cunning nymph
#

emulator...

#

"@stripe/stripe-react-native": "0.19.0",

acoustic spindle
#

and what happens if you use isApplePaySupported() instead of isPlatformPaySupported() ? Does that one resolve?

cunning nymph
#

try on a real device and it gave me this

Possible Unhandled Promise Rejection (id: 0):
TypeError: (0, _stripeReactNative.isPlatformPaySupported) is not a function. (In '(0, _stripeReactNative.isPlatformPaySupported)()', '(0, _stripeReactNative.isPlatformPaySupported)' is undefined)

acoustic spindle
#

phew that confirms what I thought - it's a versioning issue

#

So it should work once you upgrade to a newer version

cunning nymph
#

but my minium deployments is 12

#

It doesn't matter... if i update?

acoustic spindle
#

Ah, then that does matter

#

It's fine if you stay on that older version, you just shouldn't use isPlatformPaySupported() then

#

You'll want to use isApplePaySupported() and isGooglePaySupported() instead

cunning nymph
#

you have doc for react-native-stripe 0.19.0?

acoustic spindle
cunning nymph
#

but in this version the hooks are also optional?

acoustic spindle
#

You mean the useApplePay and useGooglePay hooks?

cunning nymph
#

any hook my app is class component

burnt belfryBOT
acoustic spindle
#

Yeah as far as I know the hooks should be optional, but definitely try it out

cunning nymph
#

Thank you very much, I will check the example ๐Ÿ˜„