0.1.3 • Published 3 years ago

@hivecfm/react-native-hivecfm v0.1.3

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

React Native HiveCFM

A react native SDK for HiveCFM.

Installation

Run

yarn add @hivecfm/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

PropDescriptionDefaultMandatory
usernameName of the device user created in Manage Devices in Hive CFM portal-Yes
passwordDevice User password added from Manage Devices in Hive CFM portal-Yes
addNewLanguageIf you want to add an unsupported language-No
languageApp language (en-ar-fr - new language's language code)enYes
customerNameCustomer Name-No
customerEmailCustomer Name-No
customerPhoneNumberCustomer Name-No
dispositionCodesDisposition 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={[]}
    />
PropDescriptionDefaultMandatory
languageCodeNew language's language code-Mandatory
languageJsonFileNew 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."
}