react-native-hivecfm

A react native SDK for HiveCFM.

Usage no npm install needed!

<script type="module">
  import reactNativeHivecfm from 'https://cdn.skypack.dev/react-native-hivecfm';
</script>

README

React Native HiveCFM

A react native SDK for HiveCFM.

Installation

Run

yarn add react-native-hivecfm

Dependencies

  • @react-native-community/async-storage
  • @react-native-community/datetimepicker
  • react-native-modal-datetime-picker
  • react-native-linear-gradient
  • react-native-slider
  • react-native-modal
  • typescript

if you don't have any of them please install by running

yarn add @react-native-community/async-storage @react-native-community/datetimepicker react-native-modal-datetime-picker react-native-linear-gradient react-native-slider

then Run

npx pod-install

or

cd ios && pod install

Usage

    import { HiveCFM } from 'react-native-hivecfm'

    ........

    const newLanguage = {
        languageCode: 'es',
        languageJsonFile: require('./translations/hiveSDKTranslations/es.json')
    }

    ........

    <HiveCFM
        username='InAppUser'
        password='InApp2021'
        language={'en'}
        customerName={'John Smith'}
        customerEmail={'John.Smith.2021@email.com'}
        customerPhoneNumber={'0125455141412'}
        channel={'InApp'}
        dispositionCodes={[]}
    />

Properties

Prop Description Default Mandatory
username Name of the device user created in Manage Devices in Hive CFM portal - Yes
password Device User password added from Manage Devices in Hive CFM portal - Yes
addNewLanguage If you want to add an unsupported language - No
language App language (en-ar-fr - new language's language code) en Yes
customerName Customer Name - No
customerEmail Customer Name - No
customerPhoneNumber Customer Name - No
dispositionCodes Disposition codes (Complain-Inquiry) [ ] No

If you want to add a new unsupported language

    const newLanguage = {
        languageCode: 'es',
        languageJsonFile: require('./translations/hiveSDKTranslations/es.json')
    }

    ........

    <HiveCFM
        username='InAppUser'
        password='InApp2021'
        addNewLanguage={newLanguage}
        language={'es'}
        customerName={'John Smith'}
        customerEmail={'John.Smith.2021@email.com'}
        customerPhoneNumber={'0125455141412'}
        channel={'InApp'}
        dispositionCodes={[]}
    />
Prop Description Default Mandatory
languageCode New language's language code - Mandatory
languageJsonFile New language's json file with the same keys in the default language.json file - Mandatory

Default language.json file

{
    "TakeSurveyBtnTxt": "Take a survey",
    "SubmitBtnTxt": "Submit",
    "ListChoose": "Choose here ...",
    "SuccessValidationMsg": "Success Validation",
    "TotalScoreMsg": "Total score is ",
    "TextInputPlaceholder": "Enter Text answer",
    "NumberInputPlaceholder": "Enter number answer",
    "EmailInputPlaceholder": "Enter Email answer",
    "TeleInputPlaceholder": "Enter Telephone answer",
    "PostalInputPlaceholder": "Enter postal code answer",
    "URLInputPlaceholder": "Enter URL answer",
    "EmailValidationMsg": "Please Enter a valid mail in this format xx@xxx.xxx",
    "PostalValidationMsg": "Please Enter a valid postal code Like '12345'",
    "URLValidationMsg": "Please Enter a valid URL that ends with \".com\" or \".net\" ...etc.",
    "PhoneValidationMsg": "Please Enter a valid Phone Number like xxxxxxxxxxxx from 9 to 15 digits",
    "InAppPhoneValidationMsg": "Please enter your area key and a valid phone number",
    "NumberValidationMsg": "Please Enter numbers only",
    "DateValidationMsg": "Please Enter a valid date in this format dd/mm/yyyy",
    "InAppDateValidationMsg": "Please Enter a valid date in this format dd MM, yyyy",
    "ManadatoryQuestionMsg": "\* Please answer this question",
    "ThanksMsg": "Thank you",
    "SurveySubmitMsg": "The survey is submitted successfully.",
    "SurveyErrorSubmission": "An error occurred, Sorry! couldn't submit your response",
    "Error_58": "Sorry! Can't submit empty response",
    "Error_62": "Session expired",
    "Error_63": "Error occured",
    "Error_33": "You already finished this survey, Thank you",
    "Error_38": "Sorry, This survey is expired.",
    "Error_10": "An error has occurred, we were unable to complete your submission."
}