0.1.0 • Published 1 year ago

rn-awesome-ussd-module v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-native-awesome-ussd-module

ussd module

Installation

npm install react-native-awesome-ussd-module

Usage

import { runUssd, runSubCode } from 'react-native-awesome-ussd-module';

runUssd -> run a ussd code runSubCode -> select an option from the response

// Run you short code, promise based
const result = await runUssd("*170#");

the result when its a success is a response string

example usage

const onSubmit = async () => {
    try{
        const result = await runUssd("*170#")
        //result is a string when successfully
    }catch(e) {
        //log the error, which is a response failure code
        console.log(e)
    }
}
const onSubmitOption = async () => {
    try{
        //running the subcode with an option from the response of previous ussd code requests
        //result is a string when successfully
        const result = await runSubCode("1")
    }catch(e) {
        //log the error, which is a response failure code
        console.log(e)
    }
}

Contributing

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

License

MIT


Made with create-react-native-library