Skip to content

superwall/react-native-superwall-archive

Repository files navigation

react-native-superwall

React-Native module for Superwall

See the example folder for a demo or to test your paywalls

NOTE: Currently only supports iOS
Superwall: https://superwall.com/
RevenueCat: https://www.revenuecat.com/

Running the example

Open example/App.tsx
Update the superwallApiKey var with your Superwall api key
Optional, update the revenueCatApiKey var with your RevenueCat key\

yarn
yarn example ios

Installation

NOTE: Not published to npm.

npm install react-native-superwall

Usage

Import

import { initPaywall, trigger } from 'react-native-superwall';

import {
  NativeModules,
  NativeEventEmitter,
} from 'react-native';

Event emitter. Listen for Superwall events

const eventEmitter = new NativeEventEmitter(NativeModules.Superwall);

Initailize Superwall

initPaywall(<YOUR_SUPERWALL_API_KEY>, <OPTIONAL_REVENUECAT_KEY);

Trigger paywall

const res = await trigger(<Campaign_Name>);

Listen for analyitics events

eventEmitter.addListener('superwallAnalyticsEvent', (res) => {
  console.log('Superwall event', res?.event, JSON.stringify(res, null, 4));
});

List of Superwall tracked events: https://github.com/superwall-me/paywall-ios/blob/ed7eb99b839c8eb33479af92b490f2ddcd0d5053/Sources/Paywall/Documentation.docc/AutomaticallyTrackedEvents.md

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

TODO

  • Add event trigger params to superwall, currently nil
  • Clean up swift code
  • Publish NMP package

Made with create-react-native-library

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published