0.7.1 • Published 7 months ago

boompay-react-native-sdk v0.7.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

boompay-react-native-sdk

Boom React Native SDK for partners. Want to partner with us? Click here!

Installation

This library depends on react-native-webview and you will have to install it first. See react-native-webview installation guide.

npm install boompay-react-native-sdk

or

yarn add boompay-react-native-sdk

Basic Usage

import { BoomView } from 'boompay-react-native-sdk';

export const YourComponent = () => {
  const token = '';

  const onClose = () => {
    // handle close here.
    // Sample usage could be something like this:
    navigator.navigate('/other_screen');
  };

  return (
    <BoomView
      token={token}
      primaryColor="#FFC8D0"
      secondaryColor="#171717"
      logoUri="https://path.to/your/logo/url"
      onClose={onClose}
    />
  );
};

We recommend wrapping this component into SafeArea

export default function App() {
  const token = '';

  const onClose = () => {
    // handle close here.
    // Sample usage could be something like this:
    navigator.navigate('/other_screen');
  };

  if (token) {
    return (
      <SafeAreaView style={styles.fullScreen}>
        <View style={styles.fullScreen}>
          <BoomView
            token={token}
            primaryColor="#FFC8D0"
            secondaryColor="#171717"
            theme="dark"
            logoUri="https://path.to/your/logo/url"
            onClose={onClose}
          />
        </View>
      </SafeAreaView>
    );
  }
}

const styles = StyleSheet.create({
  fullScreen: {
    flex: 1,
  },
});

Props

typedescriptionrequireddefault
tokenstringuser auth token
primaryColorstringHEX
secondaryColorstringHEX
logoUristringpublic link to your logo
themeenum"light" | "dark""dark"
sandboxModebooleantoggle between prod and sandboxtrue
onClose() => void | unknownuse to handle close WebView flow
onMessage(msg: "authError") => void | unknowntriggered when invalid token passed

Contributing

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

License

MIT ©

0.7.1

7 months ago

0.5.0

10 months ago

0.6.0

7 months ago

0.4.0

11 months ago

0.3.0

11 months ago

0.2.0

12 months ago

0.3.1

11 months ago

0.1.3

12 months ago

0.1.1

12 months ago

0.1.0

1 year ago