{"id":4565,"url":"https://github.com/jordanbyron/react-native-quick-actions","last_synced_at":"2025-09-27T07:31:29.914Z","repository":{"id":55527225,"uuid":"43207170","full_name":"jordanbyron/react-native-quick-actions","owner":"jordanbyron","description":"A react-native interface for Touch 3D home screen quick actions","archived":true,"fork":false,"pushed_at":"2021-10-27T11:27:18.000Z","size":557,"stargazers_count":1055,"open_issues_count":24,"forks_count":95,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-10-29T13:50:06.510Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jordanbyron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-26T13:52:58.000Z","updated_at":"2024-10-23T12:41:13.000Z","dependencies_parsed_at":"2022-08-15T02:31:03.055Z","dependency_job_id":null,"html_url":"https://github.com/jordanbyron/react-native-quick-actions","commit_stats":null,"previous_names":["madriska/react-native-quick-actions"],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordanbyron%2Freact-native-quick-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordanbyron%2Freact-native-quick-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordanbyron%2Freact-native-quick-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordanbyron%2Freact-native-quick-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jordanbyron","download_url":"https://codeload.github.com/jordanbyron/react-native-quick-actions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234410130,"owners_count":18828149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:16.425Z","updated_at":"2025-09-27T07:31:29.337Z","avatar_url":"https://github.com/jordanbyron.png","language":"Java","funding_links":[],"categories":["Components","\u003ca name=\"OS-\u0026-System-\u0026-File-Manager:-Native-Modules\"\u003eOS, System \u0026 File Manager: Native Modules\u003c/a\u003e","Java"],"sub_categories":["System"],"readme":"# React Native Quick Actions\n\nSupport for the new 3D Touch home screen quick actions for your React Native apps!\n\n**This project currently supports iOS 9+ and Android 7**\n\n![](/assets/example.png)\n\n## Installing\n\n```bash\n$ yarn add react-native-quick-actions\n$ react-native link react-native-quick-actions\n```\n\n### Additional steps on iOS\n\nAdd the following lines to your `AppDelegate.m` file:\n\n```obj-c\n#import \"RNQuickActionManager.h\"\n\n// @implementation AppDelegate\n\n- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL succeeded)) completionHandler {\n  [RNQuickActionManager onQuickActionPress:shortcutItem completionHandler:completionHandler];\n}\n\n// @end\n```\n\n### Manual Linking on Android\n\nAdd the following to `app/build.gradle` within the `dependencies { ... }` section\n\n```java\nimplementation project(':react-native-quick-actions')\n````\n\nAdd `import com.reactNativeQuickActions.AppShortcutsPackage;` to your `MainApplication.java`\n\nAlso add `new AppShortcutsPackage()` within the \n\n```java\npublic List\u003cReactPackage\u003e createAdditionalReactPackages() {\n  return Arrays.\u003cReactPackage\u003easList(\n    ...\n  );\n}\n```\nsection of `MainApplication.java`\n\n## Usage\n\n### Adding static quick actions - iOS only\n\nAdd these entries into to your `Info.plist` file and replace the generic stuff (Action Title, .action, etc):\n\n```xml\n\u003ckey\u003eUIApplicationShortcutItems\u003c/key\u003e\n\u003carray\u003e\n  \u003cdict\u003e\n    \u003ckey\u003eUIApplicationShortcutItemIconType\u003c/key\u003e\n    \u003cstring\u003eUIApplicationShortcutIconTypeLocation\u003c/string\u003e\n    \u003ckey\u003eUIApplicationShortcutItemTitle\u003c/key\u003e\n    \u003cstring\u003eAction Title\u003c/string\u003e\n    \u003ckey\u003eUIApplicationShortcutItemType\u003c/key\u003e\n    \u003cstring\u003e$(PRODUCT_BUNDLE_IDENTIFIER).action\u003c/string\u003e\n  \u003c/dict\u003e\n\u003c/array\u003e\n```\n\nA full list of available icons can be found here:\n\n\u003chttps://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/system-icons/#quick-action-icons\u003e\n\n### Adding dynamic quick actions\n\nIn order to add / remove dynamic actions during application lifecycle, you need to import `react-native-quick-actions` and call either `setShortcutItems` to set actions or `clearShortcutItems` to clear.\n\n```js\nimport QuickActions from \"react-native-quick-actions\";\n\nQuickActions.setShortcutItems([\n  {\n    type: \"Orders\", // Required\n    title: \"See your orders\", // Optional, if empty, `type` will be used instead\n    subtitle: \"See orders you've made\",\n    icon: \"Compose\", // Icons instructions below\n    userInfo: {\n      url: \"app://orders\" // Provide any custom data like deep linking URL\n    }\n  }\n]);\n```\n\n**NOTE** Currently android only supports a `url` key in `userInfo`. No other keys are supported. See [#93](https://github.com/jordanbyron/react-native-quick-actions/issues/93) for more information.\n\nTo clear actions:\n\n```js\nQuickActions.clearShortcutItems();\n```\n\n#### Icons\n\n##### iOS\n\nOn iOS you can use the default icons provided by Apple, they're listed here: https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/system-icons/#quick-action-icons\n\nYou can also use custom icons creating new Image set inside Image.xcassets on XCode. You'll need to define the 1x, 2x and 3x sizes.\n\n![](/assets/ios.png)\n\n##### Android\n\nOn Android you'll need to create an image file (use PNG) inside `android/app/src/main/res/drawable`.\n\nName the image with underscores, don't use hyphens.\n\n### Listening for quick actions\n\nFirst, you'll need to make sure `DeviceEventEmitter` is added to the list of\nrequires for React Native.\n\n```js\nimport { DeviceEventEmitter } from \"react-native\";\n```\n\nUse `DeviceEventEmitter` to listen for `quickActionShortcut` messages.\n\n```js\nDeviceEventEmitter.addListener(\"quickActionShortcut\", data =\u003e {\n  console.log(data.title);\n  console.log(data.type);\n  console.log(data.userInfo);\n});\n```\n\nTo get any actions sent when the app is cold-launched using the following code:\n\n```js\nimport QuickActions from \"react-native-quick-actions\";\n\nfunction doSomethingWithTheAction(data) {\n  console.log(data.title);\n  console.log(data.type);\n  console.log(data.userInfo);\n}\n\nQuickActions.popInitialAction()\n  .then(doSomethingWithTheAction)\n  .catch(console.error);\n```\n\nPlease note that on Android if android:launchMode is set to default value standard in AndroidManifest.xml, the app will be re-created each time when app is being brought back from background and it won't receive quickActionShortcut event from DeviceEventEmitter, instead popInitialAction will be receiving the app shortcut event.\n\n### Check if 3D Touch is supported\n\nThe following function will alert you if the user's device supports 3D Touch. Please\nnote this project currently only supports iOS 9+ which means this code will not\nwork on iOS devices running versions \u003c 9.0.\n\n```js\nimport QuickActions from \"react-native-quick-actions\";\n\nQuickActions.isSupported((error, supported) =\u003e {\n  if (!supported) {\n    console.log(\"Device does not support 3D Touch or 3D Touch is disabled.\");\n  }\n});\n```\n\n## License\n\nCopyright (c) 2015 Jordan Byron (http://github.com/jordanbyron/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordanbyron%2Freact-native-quick-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjordanbyron%2Freact-native-quick-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordanbyron%2Freact-native-quick-actions/lists"}