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

react-native-callkeep-android-anhbtd

v1.0.6

Published

Android incoming call UI triggered by FCM push – foreground, background, killed

Readme

react-native-callkeep-android-anhbtd

Android incoming call UI triggered by FCM push. Works in foreground, background, and killed state.

Requirements

  • React Native ≥ 0.73
  • @react-native-firebase/app + @react-native-firebase/messaging
  • google-services.json in android/app/

Installation

npm install react-native-callkeep-android-anhbtd
# or
yarn add react-native-callkeep-android-anhbtd

Autolink handles the rest. No manual MainApplication edit needed.

Android setup

Add to android/build.gradle:

classpath("com.google.gms:google-services:4.4.2")

Add to android/app/build.gradle:

apply plugin: "com.google.gms.google-services"

Usage

index.js — register FCM handlers

import messaging from '@react-native-firebase/messaging';
import { NativeModules } from 'react-native';

messaging().setBackgroundMessageHandler(async remoteMessage => {
  const data = remoteMessage.data ?? {};
  if (data.type === 'incoming_call') {
    const { CallKeep } = NativeModules;
    await CallKeep?.showIncomingCall(
      data.callId, data.callerName ?? 'Unknown',
      data.callerAvatarUrl ?? null, data.callerPhone ?? null,
      data.hasVideo === 'true', data.meta ?? null,
    );
  }
});

App.tsx — initialise

import { initCallKeep, ensureNotificationPermission, CallKeep } from 'react-native-callkeep-android-anhbtd';
import messaging from '@react-native-firebase/messaging';

useEffect(() => {
  ensureNotificationPermission();

  // Foreground FCM
  const unsub = messaging().onMessage(async ({ data = {} }) => {
    if (data.type === 'incoming_call') {
      await CallKeep.showIncomingCall({
        callId: data.callId,
        callerName: data.callerName ?? 'Unknown',
        hasVideo: data.hasVideo === 'true',
      });
    }
  });

  const cleanup = initCallKeep({
    navigate: (screen, params) => navigation.navigate(screen, params),
    goBack: () => navigation.goBack(),
  });

  return () => { unsub(); cleanup(); };
}, []);

FCM payload format

{
  "data": {
    "type": "incoming_call",
    "callId": "uuid",
    "callerName": "John Doe",
    "callerAvatarUrl": "https://...",
    "callerPhone": "+1 555 000 0000",
    "hasVideo": "false",
    "meta": "{\"roomId\":\"r_abc\"}"
  },
  "android": { "priority": "HIGH" }
}

Must be data-only (no notification block) so setBackgroundMessageHandler fires when killed.

Events

| Event | Payload | When | |---|---|---| | callIncoming | IncomingCallPayload | Push received, FGS started | | callAccepted | IncomingCallPayload | User tapped Accept | | callDeclined | { callId } | User tapped Decline | | callTimeout | { callId } | 45s elapsed, no action |

API

CallKeep.showIncomingCall(payload)   // start ringing UI
CallKeep.getPendingCall()            // read accepted call on cold start
CallKeep.endCall(callId)             // end call programmatically
CallKeep.on(event, callback)         // subscribe to events