GithubHelp home page GithubHelp logo

oguncimen / react-native-purchases Goto Github PK

View Code? Open in Web Editor NEW

This project forked from revenuecat/react-native-purchases

1.0 0.0 0.0 2.47 MB

React Native in-app purchases and subscriptions made easy. iOS and Android support.

Home Page: https://www.npmjs.com/package/react-native-purchases

License: MIT License

Java 9.99% JavaScript 36.00% Objective-C 10.18% Shell 3.99% Ruby 0.73% Swift 0.13% Kotlin 3.22% TypeScript 35.68% C 0.08%

react-native-purchases's Introduction

RevenueCat
React Native in-app subscriptions made easy

What is react-native-purchases?

React Native Purchases is a client for the RevenueCat subscription and purchase tracking system. It is an open source framework that provides a wrapper around StoreKit, Google Play Billing and the RevenueCat backend to make implementing in-app purchases in React Native easy.

Features

RevenueCat
Server-side receipt validation
➡️ Webhooks - enhanced server-to-server communication with events for purchases, renewals, cancellations, and more
🎯 Subscription status tracking - know whether a user is subscribed whether they're on iOS, Android or web
📊 Analytics - automatic calculation of metrics like conversion, mrr, and churn
📝 Online documentation up to date
🔀 Integrations - over a dozen integrations to easily send purchase data where you need it
💯 Well maintained - frequent releases
📮 Great support - Help Center

Requirements

The minimum React Native version this SDK requires is 0.58.

Installation

ExpoKit projects of version 33 or higher can successfully use react-native-purchases. If you haven't upgraded, you can follow the instructions here to upgrade.

If you're planning on ejecting from Expo, upgrade your expo version first, THEN eject. It'll save you a whole lot of hassle.

Add the library to the project

$ npm install react-native-purchases --save or $ yarn add react-native-purchases

Link library to the project

$ react-native link react-native-purchases

Additional iOS Setup

If your project uses Cocoapods

If your project already uses Cocoapods to install iOS dependencies, common in ExpoKit projects, linking the library should have added it to the podfile. If it hasn't, add the following to your project's podfile to reference the library from your node_modules folder:

pod 'RNPurchases', :path => '../node_modules/react-native-purchases'
    :inhibit_warnings => true

In your ios folder, run pod install. If you've just upgraded ExpoKit, you might need to upgrade cocoapods to the newest version: sudo gem install cocoapods.

Manual installation (if your project doesn't use CocoapodsCreate)

Make a Framework Reference in your project
  1. Drag Purchases.framework and PurchasesHybridCommon.framework from the RNPurchasessub-project under the libraries section to the outer project and create a reference.

Add iOS Frameworks to Embedded Binaries
  1. In Xcode, in project manager, select your app target.
  2. Select the general tab
  3. Drag Purchases.framework and PurchasesHybridCommon.framework from your project to the Embedded Binaries section

Add $(PROJECT_DIR)/../node_modules/react-native-purchases/ios to Framework Search paths in build settings

Add Strip Frameworks Phase

The App Store, in it's infinite wisdom, still rejects fat frameworks, so we need to strip our framework before it is deployed. To do this, add the following script phase to your build.

  1. In Xcode, in project manager, select your app target.
  2. Open the Build Phases tab
  3. Add a new Run Script, name it Strip Frameworks
  4. Add the following command "${PROJECT_DIR}/../node_modules/react-native-purchases/ios/strip-frameworks.sh" (quotes included)

Link static library

The react-native link command should have added the libRNPurchases.a library to the Linked Frameworks and Libraries section of your app target. If it hasn't add it like this:

Getting Started

Please follow the Quickstart Guide for more information on how to use the SDK

react-native-purchases's People

Contributors

aboedo avatar alankeiss avatar alfondotnet avatar anthonyjoeseph avatar bradleyflood avatar codykerns avatar coreyrab avatar dependabot[bot] avatar ericpkerr avatar flaque avatar jeanregisser avatar jeiting avatar mboettcher avatar mshmoustafa avatar pettero avatar tiinanguyen avatar tonycosentini avatar vegaro avatar zwenza avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.