React Native Quick Actions

screenshot of React Native Quick Actions
react-native

A react-native interface for Touch 3D home screen quick actions

Overview

React Native Quick Actions is a project that provides support for the new 3D Touch home screen quick actions for React Native apps. This project currently supports iOS 9+ and Android 7.

Features

  • Support for 3D Touch home screen quick actions
  • Ability to add static and dynamic quick actions
  • Listening for quick actions
  • Checking 3D Touch support on the device
  • Easy installation process
  • Compatibility with iOS 9+ and Android 7

Additional steps on iOS

Add the following lines to your AppDelegate.m file:

Manual Linking on Android

Add the following to app/build.gradle within the dependencies { ... } section. Add import com.reactNativeQuickActions.AppShortcutsPackage; to your MainApplication.java. Also, add new AppShortcutsPackage() within the section of MainApplication.java.

Usage

  • Adding static quick actions - iOS only
    • Add entries to your Info.plist file.
  • Adding dynamic quick actions
    • Import react-native-quick-actions and call setShortcutItems to set actions or clearShortcutItems to clear.

Icons

  • iOS: Use default icons provided by Apple or create new Image set inside Image.xcassets on XCode.
  • Android: Create a PNG image file inside android/app/src/main/res/drawable. Name the image with underscores.

Listening for quick actions

  • Use DeviceEventEmitter to listen for quickActionShortcut messages.

Checking 3D Touch support

  • Function to alert if the device supports 3D Touch.

Summary

React Native Quick Actions is a useful project providing support for 3D Touch home screen quick actions in React Native apps on iOS 9+ and Android 7. By following the installation steps and utilizing the features like adding static and dynamic quick actions, checking 3D Touch support, and listening for quick actions, developers can enhance the user experience of their apps.

react-native
React Native

React Native is a framework for building mobile applications using React and JavaScript. It enables developers to write once and deploy to multiple platforms, including iOS, Android, and the web, while providing a native app-like experience to users.