{"_id":"@charliecat/capacitor-plugin-siri-shorts","_rev":"1-a3a91d59eb13ed683b7ddd8ab5fb4eb5","name":"@charliecat/capacitor-plugin-siri-shorts","dist-tags":{"latest":"5.0.0-a"},"versions":{"5.0.0":{"private":false,"name":"@charliecat/capacitor-plugin-siri-shorts","version":"5.0.0","description":"Capacitor Plugin for Siri Shortcuts","main":"dist/plugin.cjs.js","module":"dist/esm/index.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","scripts":{"verify":"npm run verify:ios && npm run verify:web","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin && cd ..","verify:android":"cd android && ./gradlew clean build test && cd ..","verify:web":"npm run build","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- autocorrect --format","eslint":"eslint . --ext ts","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","docgen":"docgen --api SiriShortcutsPlugin --output-readme README.md --output-json dist/docs.json","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.js","clean":"rimraf ./dist","watch":"tsc --watch","prepublishOnly":"npm run build"},"author":{"name":"charliecat"},"license":"MIT","devDependencies":{"@capacitor/android":"^5.0.0","@capacitor/core":"^5.0.0","@capacitor/docgen":"^0.0.18","@capacitor/ios":"^5.0.0","@ionic/eslint-config":"^0.3.0","@ionic/prettier-config":"^1.0.1","@ionic/swiftlint-config":"^1.1.2","eslint":"^7.11.0","prettier":"~2.3.0","prettier-plugin-java":"~1.0.2","rimraf":"^3.0.2","rollup":"^2.32.0","swiftlint":"^1.0.1","typescript":"~4.1.5"},"peerDependencies":{"@capacitor/core":"^5.0.0"},"keywords":["capacitor","plugin","native"],"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"prettier":"@ionic/prettier-config","swiftlint":"@ionic/swiftlint-config","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"repository":{"type":"git","url":"git+https://github.com/TimoZacherl/capacitor-plugin-siri-shortcuts.git"},"bugs":{"url":"https://github.com/TimoZacherl/capacitor-plugin-siri-shortcuts/issues"},"gitHead":"7e25c4ab7c1ea90529d9c2ee143ca3cf588fbaef","homepage":"https://github.com/TimoZacherl/capacitor-plugin-siri-shortcuts#readme","_id":"@charliecat/capacitor-plugin-siri-shorts@5.0.0","_nodeVersion":"20.0.0","_npmVersion":"9.7.1","dist":{"integrity":"sha512-c4OX6Q3N5/Vjm9OOQt+gxE8gmjkwo0v6Ad/YzM4rGTkM3N/5h5YzreZi1peL8pMu+VT6dba2AZ8ZyUxCZiY30w==","shasum":"b965f32c6dbe87d5e2c220dc6d9d92c1be0b88a5","tarball":"https://registry.npmjs.org/@charliecat/capacitor-plugin-siri-shorts/-/capacitor-plugin-siri-shorts-5.0.0.tgz","fileCount":81,"unpackedSize":277217,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHEwQ6ntINmZ//8lnvK7D0Up3/33CD9OsYTCcipJhOdvAiEA2vTWR2kPPhi1MJUpEzf4Ya2cuAzFny02chftVTtt3ow="}]},"_npmUser":{"name":"charliecat","email":"k890164@gmail.com"},"directories":{},"maintainers":[{"name":"charliecat","email":"k890164@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/capacitor-plugin-siri-shorts_5.0.0_1687705672045_0.8682323769349383"},"_hasShrinkwrap":false},"5.0.0-a":{"private":false,"name":"@charliecat/capacitor-plugin-siri-shorts","version":"5.0.0-a","description":"Capacitor Plugin for Siri Shortcuts","main":"dist/plugin.cjs.js","module":"dist/esm/index.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","scripts":{"verify":"npm run verify:ios && npm run verify:web","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin && cd ..","verify:android":"cd android && ./gradlew clean build test && cd ..","verify:web":"npm run build","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- autocorrect --format","eslint":"eslint . --ext ts","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","docgen":"docgen --api SiriShortcutsPlugin --output-readme README.md --output-json dist/docs.json","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.js","clean":"rimraf ./dist","watch":"tsc --watch","prepublishOnly":"npm run build"},"author":{"name":"charliecat"},"license":"MIT","devDependencies":{"@capacitor/android":"^5.0.0","@capacitor/core":"^5.0.0","@capacitor/docgen":"^0.0.18","@capacitor/ios":"^5.0.0","@ionic/eslint-config":"^0.3.0","@ionic/prettier-config":"^1.0.1","@ionic/swiftlint-config":"^1.1.2","eslint":"^7.11.0","prettier":"~2.3.0","prettier-plugin-java":"~1.0.2","rimraf":"^3.0.2","rollup":"^2.32.0","swiftlint":"^1.0.1","typescript":"~4.1.5"},"peerDependencies":{"@capacitor/core":"^5.0.0"},"keywords":["capacitor","plugin","native"],"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"prettier":"@ionic/prettier-config","swiftlint":"@ionic/swiftlint-config","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"repository":{"type":"git","url":"git+https://github.com/TimoZacherl/capacitor-plugin-siri-shortcuts.git"},"bugs":{"url":"https://github.com/TimoZacherl/capacitor-plugin-siri-shortcuts/issues"},"gitHead":"0fea438330113ae4c6623cd4af90d6393714253a","homepage":"https://github.com/TimoZacherl/capacitor-plugin-siri-shortcuts#readme","_id":"@charliecat/capacitor-plugin-siri-shorts@5.0.0-a","_nodeVersion":"17.2.0","_npmVersion":"8.1.4","dist":{"integrity":"sha512-M6uUoqUW1b8pIM3QM9Tzz9CP2hMFV7NT29A8Vi4o5INZlELfTN5b0iMeTK+mAr+3b8syV7f7AbDqsFDzQrcDkQ==","shasum":"97cc08a710817dadedbc7d6f7eff8724f2405468","tarball":"https://registry.npmjs.org/@charliecat/capacitor-plugin-siri-shorts/-/capacitor-plugin-siri-shorts-5.0.0-a.tgz","fileCount":43,"unpackedSize":134817,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDSNUisLlH8Io3pE9vKLk+++qN7nnsjtK79YVMew+xlBAiA4aTNVFzk9Wq+PqBN/jT0JTVJlWyorTmK2SkSofPbIjQ=="}]},"_npmUser":{"name":"charliecat","email":"k890164@gmail.com"},"directories":{},"maintainers":[{"name":"charliecat","email":"k890164@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/capacitor-plugin-siri-shorts_5.0.0-a_1694005826970_0.659884729705118"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-25T15:07:51.989Z","5.0.0":"2023-06-25T15:07:52.235Z","modified":"2023-09-06T13:10:27.342Z","5.0.0-a":"2023-09-06T13:10:27.137Z"},"maintainers":[{"name":"charliecat","email":"k890164@gmail.com"}],"description":"Capacitor Plugin for Siri Shortcuts","homepage":"https://github.com/TimoZacherl/capacitor-plugin-siri-shortcuts#readme","keywords":["capacitor","plugin","native"],"repository":{"type":"git","url":"git+https://github.com/TimoZacherl/capacitor-plugin-siri-shortcuts.git"},"author":{"name":"charliecat"},"bugs":{"url":"https://github.com/TimoZacherl/capacitor-plugin-siri-shortcuts/issues"},"license":"MIT","readme":"![ios](https://shields.io/badge/iOS-%3E%3D12.0-informational)\n![xcode](https://shields.io/badge/Xcode-%3E%3D10.0-informational)\n![npm](https://shields.io/npm/dw/capacitor-plugin-siri-shorts)\n![GitHub](https://shields.io/github/license/timozacherl/capacitor-plugin-siri-shortcuts)\n![npm](https://shields.io/npm/v/@charliecat/capacitor-plugin-siri-shorts)\n![capacitor](https://shields.io/badge/Capacitor-%3E%3D3.0.0-informational)\n\n# Capacitor Plugin for Siri Shortcuts\n\n## Disclaimer\n\nthis is a fork of [`capacitor-plugin-siri-shorts`](https://www.npmjs.com/package/capacitor-plugin-siri-shorts) running on Capacitor.js v5\n\n## 🔧 Setup\n\nThe Plugin requires at least iOS 12 and Xcode 10.\n\n```sh\nnpm i capacitor-plugin-siri-shorts\n```\n\n### iOS Project\n\nAdd a new Item to `NSUserActivityTypes` inside your `Info.plist` with your Bundle Identifier:\n\n```sh\n$(PRODUCT_BUNDLE_IDENTIFIER).shortcut\n```\n\nExtend the `application:continueuserActivity,restorationHandler` function inside your `AppDelegate.swift` with the following line:\n\n```swift\nNotificationCenter.default.post(Notification(name: Notification.Name(rawValue: \"appLaunchBySiriShortcuts\"), object: userActivity, userInfo: userActivity.userInfo))\n```\n\n**Put this line before the return statement!**\n\nThe function should look similar to that:\n\n```swift\nfunc application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {\n    NotificationCenter.default.post(Notification(name: Notification.Name(rawValue: \"appLaunchBySiriShortcuts\"), object: userActivity, userInfo: userActivity.userInfo))\n    return CAPBridge.handleContinueActivity(userActivity, restorationHandler)\n}\n```\n\n## ✨ Example Usage\n\n### A full Ionic + Angular example is available [here](https://github.com/lovetodream/siri-shortcuts-ionic-angular-sample)\n\nBasic example of the donate function:\n\n```ts\nimport { SiriShortcuts } from 'capacitor-plugin-siri-shorts';\n\n...\n\nsomeAction() {\n  SiriShortcuts.donate({\n    persistentIdentifier: \"someIdentifier\",\n    title: \"A descriptive title\"\n  })\n}\n```\n\nIt's recommended to add a listener into the `initializeApp()` function inside `app.component.ts`.\n\n```ts\ninitializeApp() {\n  this.platform.ready().then(() => {\n    \n    ...\n    \n    SiriShortcuts.addListener('appLaunchBySiriShortcuts', (res) => {\n      // do something with the response of the shortcut here\n      console.log(res)\n    });\n  });\n}\n```\n\n## 🏗️ API Reference\n\n<docgen-index>\n\n* [`donate(...)`](#donate)\n* [`present(...)`](#present)\n* [`delete(...)`](#delete)\n* [`deleteAll()`](#deleteall)\n* [`addListener('appLaunchBySiriShortcuts', ...)`](#addlistenerapplaunchbysirishortcuts)\n* [`removeAllListeners()`](#removealllisteners)\n* [Interfaces](#interfaces)\n\n</docgen-index>\n\n<docgen-api>\n<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->\n\n### donate(...)\n\n```typescript\ndonate(options: Options) => Promise<any>\n```\n\nDonates the provided action to Siri/Shortcuts\n\n| Param         | Type                                        | Description                                                |\n| ------------- | ------------------------------------------- | ---------------------------------------------------------- |\n| **`options`** | <code><a href=\"#options\">Options</a></code> | <a href=\"#options\">Options</a> to specify for the donation |\n\n**Returns:** <code>Promise&lt;any&gt;</code>\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### present(...)\n\n```typescript\npresent(options: Options) => Promise<any>\n```\n\nPresents a modal to the user to add the shortcut to siri and access it via voice\n\n| Param         | Type                                        | Description                                                |\n| ------------- | ------------------------------------------- | ---------------------------------------------------------- |\n| **`options`** | <code><a href=\"#options\">Options</a></code> | <a href=\"#options\">Options</a> to specify for the donation |\n\n**Returns:** <code>Promise&lt;any&gt;</code>\n\n**Since:** 2.2.0\n\n--------------------\n\n\n### delete(...)\n\n```typescript\ndelete(options: DeleteOptions) => Promise<void>\n```\n\nDeletes the previous donations with the provided persistent identifiers\n\n| Param         | Type                                                    |\n| ------------- | ------------------------------------------------------- |\n| **`options`** | <code><a href=\"#deleteoptions\">DeleteOptions</a></code> |\n\n**Since:** 2.1.0\n\n--------------------\n\n\n### deleteAll()\n\n```typescript\ndeleteAll() => Promise<void>\n```\n\nDelets all the previously donated activities\n\n**Since:** 2.1.0\n\n--------------------\n\n\n### addListener('appLaunchBySiriShortcuts', ...)\n\n```typescript\naddListener(eventName: 'appLaunchBySiriShortcuts', listenerFunc: (shortcut: Shortcut) => void) => Promise<PluginListenerHandle> & PluginListenerHandle\n```\n\nListens to events associated with Siri Shortcuts\nand notifies the listenerFunc if a Shortcuts has been executed.\n\n| Param              | Type                                                                 | Description                                     |\n| ------------------ | -------------------------------------------------------------------- | ----------------------------------------------- |\n| **`eventName`**    | <code>'appLaunchBySiriShortcuts'</code>                              | Name of the event                               |\n| **`listenerFunc`** | <code>(shortcut: <a href=\"#shortcut\">Shortcut</a>) =&gt; void</code> | Function to execute when listener gets notified |\n\n**Returns:** <code>Promise&lt;<a href=\"#pluginlistenerhandle\">PluginListenerHandle</a>&gt; & <a href=\"#pluginlistenerhandle\">PluginListenerHandle</a></code>\n\n**Since:** 2.0.1\n\n--------------------\n\n\n### removeAllListeners()\n\n```typescript\nremoveAllListeners() => Promise<void>\n```\n\nRemove all listeners for this plugin.\n\n**Since:** 2.0.1\n\n--------------------\n\n\n### Interfaces\n\n\n#### Options\n\n<a href=\"#options\">Options</a> to specify for the donation\n\n| Prop                            | Type                                          | Description                                                                                                                                                                                                      |\n| ------------------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **`persistentIdentifier`**      | <code>string</code>                           | Specify an identifier to uniquely identify the shortcut, in order to be able to remove it                                                                                                                        |\n| **`title`**                     | <code>string</code>                           | Specify a title for the shortcut, which is visible to the user as the name of the shortcut                                                                                                                       |\n| **`userInfo`**                  | <code><a href=\"#userinfo\">UserInfo</a></code> | Provide a key-value object that contains information about the shortcut, this will be returned in the getActivatedShortcut method. It is not possible to use the persistentIdentifier key, it is used internally |\n| **`suggestedInvocationPhrase`** | <code>string</code>                           | Specify the phrase to give the user some inspiration on what the shortcut to call                                                                                                                                |\n| **`isEligibleForSearch`**       | <code>boolean</code>                          | This value defaults to true, set this value to make it searchable in Siri                                                                                                                                        |\n| **`isEligibleForPrediction`**   | <code>boolean</code>                          | This value defaults to true, set this value to set whether the shortcut eligible for prediction                                                                                                                  |\n\n\n#### UserInfo\n\n\n#### DeleteOptions\n\n<a href=\"#options\">Options</a> to specify for a deletion\n\n| Prop              | Type                  | Description                                             |\n| ----------------- | --------------------- | ------------------------------------------------------- |\n| **`identifiers`** | <code>string[]</code> | Array of persistent identifiers which should be deleted |\n\n\n#### PluginListenerHandle\n\n| Prop         | Type                                      |\n| ------------ | ----------------------------------------- |\n| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |\n\n\n#### Shortcut\n\nObject which will be returned by the listener which\ncontains the persistent identifier and the userinfo\nof a shortcut\n\n| Prop                       | Type                |\n| -------------------------- | ------------------- |\n| **`persistentIdentifier`** | <code>string</code> |\n\n</docgen-api>\n","readmeFilename":"README.md"}