1.0.3 • Published 2 years ago

react-native-paydala-sdk v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-paydala-sdk

This is a react-native library that's supported on Android | iOS SDK for Paydala

Installation

To ensure the best experience, we recommend to install the latest version of React Native.

npm install react-native-paydala-sdk

This will install the library in your project.

Peer Dependecies

There are some dependencies in the library that use native code and hence must be added inside your project so that the proper linking happens.

npm install react-native-permissions react-native-safe-area-context react-native-svg react-native-vector-icons @react-native-async-storage/async-storage @react-native-community/datetimepicker react-native-geolocation-service
DependecyPurpose
react-native-permissionsto get permissions to access the geo location of the user
react-native-safe-area-contextto Handle the physical notches in latest devices
react-native-svgload the image assets used in the library
@react-native-async-storage/async-storagesave the token across sessions
@react-native-community/datetimepickerto show the native date pickers
react-native-geolocation-serviceto access the native geolocation apis

If you are using RN < 0.60 please ensure you are linking the above packages in your project as per their respective instructions.

Note on react-native-permissions You will require only the geolocation permissions when the app is active so you add only the following to your podfile

target 'YourAwesomeProject' do
      pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"

And the following in your info.plist file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>YOUR TEXT</string>
</dict>

Usage

import { PayWithPaydala } from "react-native-paydala";

// ...

export default function YourApp() {
  return (
    <View>
      <PayWithPaydala 
        clientName={'Your company name'} 
        clientId={"Your client id"}
        defaultUser= {{
            name:"userName",
            email:"userEmail",
            phone: "userPhone"
        }}/>
    </View>
  );
}
PropsDescriptionValues
clientNameThe brand name to be used inside the SDKstring
clientIdA unique identifier for your brand as provided by the Paydala teamstring
defaultUsercan be used to prefill some form values to improve the user experience{ name:string, email:string, phone:string }