@config-plugins/react-native-quick-actions

Config plugin for react-native-quick-actions package

Usage no npm install needed!

<script type="module">
  import configPluginsReactNativeQuickActions from 'https://cdn.skypack.dev/@config-plugins/react-native-quick-actions';
</script>

README

@config-plugins/react-native-quick-actions

Expo Config Plugin to auto configure react-native-quick-actions when the native code is generated (expo prebuild).

demo-ios

Expo installation

Tested against Expo SDK 43

This package cannot be used in the "Expo Go" app because it requires custom native code.

  • First install the package with yarn, npm, or expo install.
expo install react-native-quick-actions @config-plugins/react-native-quick-actions

After installing this npm package, add the config plugin to the plugins array of your app.json or app.config.js:

{
  "expo": {
    "plugins": ["@config-plugins/react-native-quick-actions"]
  }
}

Next, rebuild your app as described in the "Adding custom native code" guide.

API

The plugin provides props for extra customization. Every time you change the props or plugins, you'll need to rebuild (and prebuild) the native app. If no extra properties are added, defaults will be used.

iOS only; an array of the objects with the following keys:

  • title: (string): UIApplicationShortcutItemTitle: Name of action (required)
  • type: (string): UIApplicationShortcutItemType: A unique string that the system passes to your app (required)
  • subtitle (string): UIApplicationShortcutItemSubtitle: Subtitle message
  • iconType (string): UIApplicationShortcutItemIconType: List of icon types (ex: "UIApplicationShortcutIconTypeLocation")
  • iconSymbolName (string): UIApplicationShortcutItemIconSymbolName: Name of system icon, here is an unofficial list (ex: "square.stack.3d.up")
  • iconFile (string): UIApplicationShortcutItemIconFile: Name of the resource file (Not supported)
  • userInfo (XML.XMLObject): UIApplicationShortcutItemUserInfo: An optional, app-defined dictionary. One use for this dictionary is to provide app version information, as described in the “App Launch and App Update Considerations for Quick Actions” section of the overview in UIApplicationShortcutItem Class Reference.

Example

{
  "expo": {
    "plugins": [
      [
        "@config-plugins/react-native-quick-actions",
        [
          {
            "title": "Take Photo",
            "type": "photo",
            "iconType": "UIApplicationShortcutIconTypeCapturePhoto"
          }
        ]
      ]
    ]
  }
}