google-pay / react-native-make-payment

React Native library for making native payments
Apache License 2.0
19 stars 7 forks source link

Error on iOS: cannot find getConstants() of null #20

Open kuldip-simform opened 6 months ago

kuldip-simform commented 6 months ago

Hi, I have added this package in expo app for react native. For android this works perfectly but once I run app on iOS, I was getting this error. cannot find getConstants() of null.

Can you tell me what should I do to get rid of this error on iOS?

Thank you.

alex-vasylchenko commented 5 months ago

@kuldip-simform do smth like this in your code. In this case you will never call import "@google/react-native-make-payment" in IOS app

const usePlatformPay = isIOS
    ? require("@/services/ApplePay").useApplePay
    : require("@/services/GooglePay").useGooglePay;