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

@mbdayo/react-native-app-shortcuts

v1.1.0

Published

React Native package for iOS UIApplicationShortcutItem and Android App Shortcuts

Readme

react-native-app-shortcuts

React Native package for iOS UIApplicationShortcutItem (Quick Actions) and Android App Shortcuts.

This package allows you to add home screen shortcuts to your React Native app, enabling users to quickly access specific actions within your app directly from the home screen.

Features

  • Create dynamic shortcuts for iOS and Android
  • Handle shortcut selection events
  • Check if shortcuts are supported on the device
  • TypeScript support
  • Full compatibility with React Native's New Architecture (Fabric & TurboModules)

Installation

npm install @mbdayo/react-native-app-shortcuts

or

yarn add @mbdayo/react-native-app-shortcuts

iOS Setup

Pod Installation

cd ios && pod install

AppDelegate Configuration

You need to modify your AppDelegate to handle shortcut selection events.

For Objective-C (AppDelegate.m)

Add the import at the top of your file:

#import <@mbdayo/react-native-app-shortcuts/RNAppShortcuts.h>

Add the following method to your AppDelegate implementation:

- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler {
  [RNAppShortcuts handleShortcutItem:shortcutItem];
  completionHandler(YES);
}
For Swift (AppDelegate.swift)

First, create or modify your bridging header to include:

// Bridging-Header.h
#import <@mbdayo/react-native-app-shortcuts/RNAppShortcuts.h>

Then add the following method to your AppDelegate:

override func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
  RNAppShortcuts.handle(shortcutItem)
  completionHandler(true)
}

Android Setup

No additional setup is required for Android.

New Architecture Support

This package fully supports React Native's New Architecture (Fabric & TurboModules). When your app is built with the New Architecture enabled, the package will automatically use TurboModules for better performance.

To enable the New Architecture in your app:

For iOS:

RCT_NEW_ARCH_ENABLED=1 pod install

For Android:

Add to your gradle.properties:

newArchEnabled=true

Usage

import AppShortcuts from '@mbdayo/react-native-app-shortcuts';

// Check if shortcuts are supported
const checkSupport = async () => {
  const isSupported = await AppShortcuts.isSupported();
  console.log('Shortcuts supported:', isSupported);
};

// Set dynamic shortcuts
const setShortcuts = async () => {
  const shortcuts = [
    {
      type: 'compose', // unique identifier
      title: 'New Message',
      subtitle: 'Create a new message', // optional
      iconName: 'compose_icon', // optional, must be in app assets
    },
    {
      type: 'search',
      title: 'Search',
      iconName: 'search_icon',
    },
  ];

  const success = await AppShortcuts.setShortcuts(shortcuts);
  console.log('Shortcuts set:', success);
};

// Clear all shortcuts
const clearShortcuts = async () => {
  const success = await AppShortcuts.clearShortcuts();
  console.log('Shortcuts cleared:', success);
};

// Check if app was launched from a shortcut
const checkInitialShortcut = async () => {
  const shortcut = await AppShortcuts.getInitialShortcut();
  if (shortcut) {
    console.log('App launched from shortcut:', shortcut.type);
    handleShortcut(shortcut.type);
  }
};

// Listen for shortcut selection when app is running
const shortcutListener = AppShortcuts.addListener((event) => {
  console.log('Shortcut selected:', event.type);
  handleShortcut(event.type);
});

// Handle shortcut action
const handleShortcut = (type) => {
  switch (type) {
    case 'compose':
      // Navigate to compose screen
      break;
    case 'search':
      // Navigate to search screen
      break;
    // Add more cases as needed
  }
};

// Don't forget to remove the listener when component unmounts
useEffect(() => {
  checkInitialShortcut();

  return () => {
    shortcutListener(); // Remove listener
  };
}, []);

## Icons

### iOS

For iOS, you need to add your icon images to your app's asset catalog. The `iconName` parameter should match the name of the image in your asset catalog.

### Android

For Android, you need to add your icon images to the drawable resources folder. The `iconName` parameter should match the name of the drawable resource (without the file extension).

## API Reference

### Methods

#### `isSupported(): Promise<boolean>`

Check if shortcuts are supported on the device.

#### `getInitialShortcut(): Promise<ShortcutEvent | null>`

Get the shortcut that was used to launch the app (if any).

#### `setShortcuts(shortcuts: Shortcut[]): Promise<boolean>`

Set dynamic shortcuts for the app.

#### `clearShortcuts(): Promise<boolean>`

Clear all dynamic shortcuts.

#### `addListener(callback: (event: ShortcutEvent) => void): () => void`

Add a listener for when a shortcut is used while the app is running. Returns a function to remove the listener.

### Types

#### `Shortcut`

```typescript
interface Shortcut {
  type: string; // Unique identifier
  title: string; // Display title
  subtitle?: string; // Optional subtitle
  iconName?: string; // Optional icon name
  userInfo?: Record<string, any>; // Optional additional data
}

ShortcutEvent

interface ShortcutEvent {
  type: string; // The type/id of the shortcut that was used
}

License

MIT