Skip to content

A lightweight React Native module for dialing USSD codes (e.g. *123#): on Android via ACTION_CALL (needs CALL_PHONE permission) and on iOS via the system dialer, exposing a Promise-based API dialUssd(code: string): Promise<void> with no extra dependencies, plus Bob-powered TS build & publish instructions.

License

Notifications You must be signed in to change notification settings

octahori/react-native-dial-ussd

Repository files navigation

react-native-dial-ussd

A React Native native module to dial USSD codes programmatically on Android & iOS.

Features

  • Dial any USSD code (e.g. *123#).
  • Promise-based API dialUssd(code: string): Promise<void>.
  • Ready-to-use DialUssdButton component.

Installation

# with yarn
yarn add react-native-dial-ussd

# with npm
npm install react-native-dial-ussd

iOS only:

cd ios && pod install

Usage

import { dialUssd, DialUssdButton } from 'react-native-dial-ussd';

// imperative
await dialUssd('*123#');

// declarative
<DialUssdButton code="*123#" />

DialUssdButton Props

Prop Type Default Description
code string USSD code to dial (e.g. *123#).
title string Dial ${code} Button label
buttonStyle StyleProp<ViewStyle> Override button container style
textStyle StyleProp<TextStyle> Override label style

Example

Clone this repo and run the example app:

yarn
yarn example android   # or ios

About

A lightweight React Native module for dialing USSD codes (e.g. *123#): on Android via ACTION_CALL (needs CALL_PHONE permission) and on iOS via the system dialer, exposing a Promise-based API dialUssd(code: string): Promise<void> with no extra dependencies, plus Bob-powered TS build & publish instructions.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published