1.0.14 • Published 3 years ago

react-native-smartprice v1.0.14

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

SmartPRICE™ React Native Smartprice SDK

includes:

  • SmartPRICE™ button and modal component for React Native Expo Project
  • Example Expo Project to showcase the use of the SmartPrice component

Installation

# npm:
$ npm install react-native-smartprice
# yarn:
$ yarn add react-native-smartprice

Use SmartPrice component

<SmartPrice/>

import SmartPrice to your code base

import { SmartPrice } from 'react-native-smartprice';

Add <SmartPrice/> tag to your tsx file

<SmartPrice />

You have several props to configure the tag

Prefilled user data

<SmartPrice
  userData={{
    phoneNumber: '1234567890', // Ten Digit Number (A less thatn 10 digit number will not load)
    firstName: 'John',
    lastName: 'Smith',
    dateOfBirth: new Date('10-10-1978'), // A valid date is between 18-65 years old
    email: 'john@pixl.com', // A wrongly formatted email will not be loaded
  }}
/>

Device token

If you have the deviceToken of your user you can set that in the tag and it will load their SmartPrice savings card automatically.

<SmartPrice
  userData={{
    deviceToken: 'valid device token',
  }}
/>

Obtain membership data when the user finishes creating the account

<SmartPrice onFinishFlow={onFinish} />;

const onFinish = (membershipData) => {
  const { carrierPCN, memberId, rxBin, rxGroup, deviceToken } = membershipData;
  //membershipData.deviceToken? is optional
};

If you set the getDeviceToken flag to 'true' you will get back the deviceToken so you can use it later

<SmartPrice getDeviceToken={true} />

Configure your broker source identifier

Each Prescryptive partner has a broker identifier which you can pass as a prop to the SmartPrice component

<SmartPrice source='yourbrokerid' />

Configure component for testing environment

As in the example directory you may want to run the component in our testing environment. To achieve that only set the buildTarget='test' in the SmartPrice component

<SmartPrice buildTarget='test' />

The two possible values are 'test' and 'prod'. The default value is 'prod' This variable switches the target's endpoints to register and retrieve member information.

Development

Review the Example project configuration

Run example with:

$ yarn
$ yarn web

Updates to the project, you may test it locally by packaging the main project and test it in the example project.

  1. npm pack to get ().tgz
  2. Cut/paste ().tgz to example project
  3. yarn add file:().tgz
1.0.14

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.7-alpha.1

3 years ago

1.0.7-alpha.2

3 years ago

1.0.13-alpha.1

3 years ago

1.0.12-alpha.1

3 years ago

1.0.8-alpha.4

3 years ago

1.0.8-alpha.1

3 years ago

1.0.10-alpha.3

3 years ago

1.0.8-alpha.2

3 years ago

1.0.8-alpha.3

3 years ago

1.0.10-alpha.1

3 years ago

1.0.10-alpha.2

3 years ago

1.0.11-alpha.1

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago