npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@balram_01/react-native-dialpad

v0.4.2

Published

dialer for react native

Readme

npm version npm downloads TypeScript License: MIT Platform

A powerful, native dialer and call management library for React Native.


✦ Why this library?

react-native-dialpad allows you to create fully-functional dialer applications, request default dialer system roles, fetch and manage contacts, and handle native Telecom/InCallService routing seamlessly.

| Feature | Description | |---|---| | Native Call UI | Hooks directly into Android's InCallService for native incoming/outgoing call screens. | | Telecom Integration | Proper audio routing and microphone mute/unmute handling. | | Default Dialer Role | Seamless methods to request the user to set your app as the default system dialer. | | Contact Management | Fetch all contacts, create new contacts, and manage blocked numbers natively. | | Call Logs | Easily fetch the device's call history directly into React Native. | | Call Settings | Toggle vibrations, secure numbers, call forwarding, and quick reply management. |


📦 Installation

# npm
npm install @balram_01/react-native-dialpad

# yarn
yarn add @balram_01/react-native-dialpad

⚙️ Android Setup

To use this library as a default dialer, you must configure your Android Manifest properly.

1. Modify AndroidManifest.xml

Open android/app/src/main/AndroidManifest.xml and ensure you have the following permissions and intent filters:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

  <!-- Required Permissions for Dialer Functionality -->
  <uses-permission android:name="android.permission.CALL_PHONE" />
  <uses-permission android:name="android.permission.READ_CONTACTS" />
  <uses-permission android:name="android.permission.WRITE_CONTACTS" />
  <uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
  <uses-permission android:name="android.permission.READ_CALL_LOG" />
  <uses-permission android:name="android.permission.WRITE_CALL_LOG" />

  <application ...>
    <activity
      android:name=".MainActivity"
      android:exported="true">
      
      <!-- Standard Launcher Intent -->
      <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>

      <!-- REQUIRED: Intent filter to qualify as a system dialer -->
      <intent-filter>
          <action android:name="android.intent.action.DIAL" />
          <category android:name="android.intent.category.DEFAULT" />
      </intent-filter>
      
      <!-- Intent filter for handling tel: links -->
      <intent-filter>
          <action android:name="android.intent.action.DIAL" />
          <category android:name="android.intent.category.DEFAULT" />
          <data android:scheme="tel" />
      </intent-filter>

    </activity>
  </application>
</manifest>

⚡ Quick Start & Usage

1. Request Default Dialer Role

Before making calls through your custom UI, your app should be set as the default dialer.

import { requestRole, checkIfDefaultDialer, openDialerSetting } from '@balram_01/react-native-dialpad';

const setupDialer = async () => {
  const isDefault = await checkIfDefaultDialer();
  
  if (!isDefault) {
    try {
      const result = await requestRole();
      if (result === 'Role granted') {
        console.log('App is now the default dialer!');
      }
    } catch (error) {
      console.error('User declined or request failed', error);
      // Fallback: Open settings for the user to manually set it
      await openDialerSetting();
    }
  }
};

2. Make a Call

Ensure you have requested runtime permissions (CALL_PHONE) before calling this method.

import { makeCall } from '@balram_01/react-native-dialpad';
import { PermissionsAndroid } from 'react-native';

const handleMakeCall = async (phoneNumber: string) => {
  const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.CALL_PHONE);
  
  if (granted === PermissionsAndroid.RESULTS.GRANTED) {
    try {
      await makeCall(phoneNumber);
    } catch (e) {
      console.error('Call failed:', e);
    }
  }
};

3. Fetch Call Logs

Fetch recent call history natively from the device.

import { getCallLogs } from '@balram_01/react-native-dialpad';

const fetchLogs = async () => {
  try {
    const logs = await getCallLogs();
    console.log(`Fetched ${logs.length} logs! Recent: ${logs[0]?.number}`);
  } catch (err) {
    console.error('Failed to fetch call logs', err);
  }
};

4. Fetch Contacts

Ensure you have requested the READ_CONTACTS permission at runtime.

import { getAllContacts } from '@balram_01/react-native-dialpad';

const fetchContacts = async () => {
  try {
    const contacts = await getAllContacts();
    console.log(`Fetched ${contacts.length} contacts!`);
  } catch (err) {
    console.error('Failed to fetch contacts', err);
  }
};

📋 API Reference

| Method | Description | Return Type | |---|---|---| | checkIfDefaultDialer() | Checks if the app is currently the default dialer | Promise<boolean> | | getDefaultDialerPackage() | Returns the package name of the default dialer | Promise<string> | | requestRole() | Prompts user to set app as default dialer | Promise<string> | | openDialerSetting() | Opens the default apps settings menu | Promise<string> | | makeCall(phone) | Initiates a telecom call to the given number | Promise<string> | | getCallLogs() | Fetches recent call history | Promise<Array<CallLog>> | | getAllContacts() | Returns a list of the device's contacts | Promise<Array<Contact>> | | getContactById(id) | Fetches detailed info for a specific contact | Promise<ContactMap> | | createNewContact(contact)| Creates a new contact entry | Promise<string> | | updateContact(contact) | Updates an existing contact | Promise<string> | | deleteContact(contact) | Deletes a contact | Promise<string> | | isNumberBlocked(phone) | Checks if a number is blocked | Promise<boolean> | | addBlockedNumber(phone)| Blocks the specified phone number | Promise<string> | | removeBlockedNumber(phone)| Unblocks the specified phone number | Promise<string> | | getBlockedNumbers() | Returns a list of all blocked numbers | Promise<Array<string>> | | toggleVibration(value) | Enables/disables vibration for incoming calls | Promise<string> | | forwardAllCalls(...) | Configures Call Forwarding unconditionally | Promise<string> |


🤝 Contributing

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

📄 License

MIT © Balram

If this saved you time, consider giving it a ⭐ on GitHub — it helps others find it.