Alright, so I thought I would go into detail. I have everything working and setup, builds working on iOS and Android, but when I try and run the app, calling stripe from the tipsi-stripe module, I get an error stating that stripe is undefined, in both Android and iOS. Android is setup pretty much exactly as it says in the docs, and how it links by running react-native link
. The only thing I did differently, was I didn’t include the Stripe package in my MainApplication.java, as it is already called in Expo, and will result in the error I initially had, what I did end up doing was this, in my app/build.gradle
, I set it up like this:
dependencies {
compile project(':tipsi-stripe')
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:multidex:1.0.1'
compile('host.exp.exponent:expoview:23.0.0@aar') {
exclude group: 'com.facebook.android', module: 'facebook-android-sdk'
exclude group: 'com.facebook.android', module: 'audience-network-sdk'
exclude group: 'io.nlopez.smartlocation', module: 'library'
exclude group: 'com.github.thefuntasty', module: 'CreditCardEntry'
exclude group: 'com.gettipsi', module: 'stripeview'
exclude group: 'com.stripe', module: 'stripe-android'
transitive = true
}
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile('com.facebook.android:audience-network-sdk:4.+') {
exclude module: 'play-services-ads'
}
compile('io.nlopez.smartlocation:library:3.2.11') {
transitive = false
}
compile project(':tipsi-stripe')
it seems fine here, and then on the ios side, I have this in my pod file:
...
pod 'GLog',
:podspec => "../node_modules/react-native/third-party-podspecs/GLog.podspec",
:inhibit_warnings => true
# Add payments
pod 'Stripe', '~> 11.2.0'
# Payment dependancies
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Crash'
pod 'Firebase/Database'
pod 'Firebase/Firestore'
pod 'Firebase/Messaging'
pod 'Firebase/Performance'
pod 'Firebase/Storage'
pod 'tipsi-stripe', :path => '../node_modules/tipsi-stripe/tipsi-stripe.podspec'
I’ve also tried variants of that tipsi-stripe
pod, but it didn’t make any difference. Tried also running react-native link
with and without this, it says it’s been linked, but I run into issues on this line in the tipsi module:
const { TPSStripeManager } = NativeModules
← this always returns undefined.
Any ideas as to why this is happening, or where I would look to modify the code in the library to get it to work?