#jesuisilya
1 messages · Page 1 of 1 (latest)
Here's full code
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { View } from 'react-native';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { PlatformPayButton, isPlatformPaySupported } from '@stripe/stripe-react-native';
import {
addStripeAccount,
generateStripePaymentIntentDetails,
} from '../../resources/user/user.actions';
import {
selectStripePaymentIntent,
selectUserProfile,
} from '../../resources/user/user.selectors';
import Log from '../../../log.config';
const ApplePay = ({ navigation, route, setLoading, ...props }) => {
const [isApplePaySupported, setIsApplePaySupported] = useState(false);
useEffect(() => {
Log.debug('Is Apple Pay Supported?', isApplePaySupported);
}, [isApplePaySupported]);
useEffect(() => {
(async function () {
setIsApplePaySupported(await isPlatformPaySupported());
})();
}, []);
return (
<View>
{ isApplePaySupported && (
<PlatformPayButton
type="standard"
onPress={() => {
}}
style={{
height: 40,
marginHorizontal: 20,
}}
/>
)}
</View>
);
};
Thanks for sharing let me check...
Can you try to reproduce the issue on this sample?
https://github.com/stripe/stripe-react-native/blob/master/example/src/screens/ApplePayScreen.tsx#L310
iPhone 12 (iOS 16)
Are you using a virtual device or a real device ?
Do you have a real Apple Pay card set in that device ?
No, I didn't realize this was neccessary 😅 , let me add it and try again
it is on real devices, otherwise you can use virtual device on your mac in order to use the virtual card set there.
Okay, I've added a card to apple pay but isPlatformPaySupported still showing as false when I print the output
Did you tried to use that card with Apple Pay other than your app?
No, do you think it's a problem with the card?
It could be yeah. But in all case, you need to make sure that you have a working Apple Pay in your real device first, before testing your integration.
Just made an order with apple pay somewhere else, so it is 100% working on this device