Linking

react-native cli

Run react-native link tipsi-stripe so your project is linked against your Xcode project and all CocoaPods dependencies are installed.

iOS

CocoaPods

Setup your Podfile like the included example/ios/Podfile then run pod install.

  1. Open your project in Xcode workspace.

  2. Drag the following folder into your project:

    • node_modules/tipsi-stripe/ios/TPSStripe/

Manual

Open your project in Xcode, right click on Libraries and click Add Files to "Your Project Name".

  1. Look under node_modules/tipsi-stripe/ios and add TPSStripe.xcodeproj.

  2. Add libTPSStripe.a to Build PhasesLink Binary With Libraries.

  3. Click on TPSStripe.xcodeproj in Libraries and go the Build Settings tab.
    Double click the text to the right of Header Search Paths and verify that it has

    • $(SRCROOT)/../../react-native/React

    • ${SRCROOT}/../../../ios/Pods/Headers/Public

    If they aren't, then add them. This is so Xcode is able to find the headers that the TPSStripe source files are referring to by pointing to the header files installed within the react-native node_modules directory.

  4. Whenever you want to use it within React code now you can:

    • import stripe from 'tipsi-stripe'

Android

Manual

In your android/app/build.gradle add:

...
dependencies {
  ...
+ compile project(':tipsi-stripe')
}

In yourandroid/settings.gradleadd:

...

+include ':tipsi-stripe'
+project(':tipsi-stripe').projectDir = new File(rootProject.projectDir, '../node_modules/tipsi-stripe/android')

In yourandroid/build.gradleadd:

...

allprojects {
  repositories {
  ...
+ maven { url "https://jitpack.io" }
  }
}

In your android/app/src/main/java/com/%YOUR_APP_NAME%/MainApplication.java add:

...
+ import com.gettipsi.stripe.StripeReactPackage;
...
protected List <ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
-   new MainReactPackage()
+   new MainReactPackage(),
+   new StripeReactPackage()
  );
}

Ensure that you have Google Play Services installed.

Genymotion

For Genymotion you can follow these instructions.

For a physical device you need to search on Google for 'Google Play Services'. There will be a link that takes you to the Play Store and from there you will see a button to update it (do not search within the Play Store).

results matching ""

    No results matching ""