@bubble-labs/capacitor-plugin-siri-shorts 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapacitorPluginSiriShorts.podspec +17 -0
- package/LICENSE +21 -0
- package/README.md +251 -0
- package/android/build.gradle +58 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/android/gradle.properties +23 -0
- package/android/gradlew +248 -0
- package/android/gradlew.bat +92 -0
- package/android/proguard-rules.pro +21 -0
- package/android/settings.gradle +2 -0
- package/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java +26 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/timozacherl/plugins/CapSiriShortcuts/SiriShortcuts.java +38 -0
- package/android/src/main/res/layout/bridge_layout_main.xml +15 -0
- package/android/src/main/res/values/colors.xml +3 -0
- package/android/src/main/res/values/strings.xml +3 -0
- package/android/src/main/res/values/styles.xml +3 -0
- package/android/src/test/java/com/getcapacitor/ExampleUnitTest.java +18 -0
- package/dist/docs.json +279 -0
- package/dist/esm/definitions.d.ts +112 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/plugin.cjs.js +10 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +13 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/Info.plist +24 -0
- package/ios/Plugin/Plugin.h +10 -0
- package/ios/Plugin/Plugin.m +11 -0
- package/ios/Plugin/Plugin.swift +169 -0
- package/ios/Plugin.xcodeproj/project.pbxproj +554 -0
- package/ios/Plugin.xcodeproj/xcshareddata/xcschemes/Plugin.xcscheme +77 -0
- package/ios/Plugin.xcworkspace/contents.xcworkspacedata +10 -0
- package/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/PluginTests/Info.plist +22 -0
- package/ios/PluginTests/PluginTests.swift +35 -0
- package/ios/Podfile +16 -0
- package/ios/Podfile.lock +22 -0
- package/package.json +80 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
@rem
|
|
2
|
+
@rem Copyright 2015 the original author or authors.
|
|
3
|
+
@rem
|
|
4
|
+
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
@rem you may not use this file except in compliance with the License.
|
|
6
|
+
@rem You may obtain a copy of the License at
|
|
7
|
+
@rem
|
|
8
|
+
@rem https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
@rem
|
|
10
|
+
@rem Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
@rem See the License for the specific language governing permissions and
|
|
14
|
+
@rem limitations under the License.
|
|
15
|
+
@rem
|
|
16
|
+
|
|
17
|
+
@if "%DEBUG%"=="" @echo off
|
|
18
|
+
@rem ##########################################################################
|
|
19
|
+
@rem
|
|
20
|
+
@rem Gradle startup script for Windows
|
|
21
|
+
@rem
|
|
22
|
+
@rem ##########################################################################
|
|
23
|
+
|
|
24
|
+
@rem Set local scope for the variables with windows NT shell
|
|
25
|
+
if "%OS%"=="Windows_NT" setlocal
|
|
26
|
+
|
|
27
|
+
set DIRNAME=%~dp0
|
|
28
|
+
if "%DIRNAME%"=="" set DIRNAME=.
|
|
29
|
+
@rem This is normally unused
|
|
30
|
+
set APP_BASE_NAME=%~n0
|
|
31
|
+
set APP_HOME=%DIRNAME%
|
|
32
|
+
|
|
33
|
+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
|
34
|
+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
|
35
|
+
|
|
36
|
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
37
|
+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
|
38
|
+
|
|
39
|
+
@rem Find java.exe
|
|
40
|
+
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
41
|
+
|
|
42
|
+
set JAVA_EXE=java.exe
|
|
43
|
+
%JAVA_EXE% -version >NUL 2>&1
|
|
44
|
+
if %ERRORLEVEL% equ 0 goto execute
|
|
45
|
+
|
|
46
|
+
echo.
|
|
47
|
+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
48
|
+
echo.
|
|
49
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
50
|
+
echo location of your Java installation.
|
|
51
|
+
|
|
52
|
+
goto fail
|
|
53
|
+
|
|
54
|
+
:findJavaFromJavaHome
|
|
55
|
+
set JAVA_HOME=%JAVA_HOME:"=%
|
|
56
|
+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
57
|
+
|
|
58
|
+
if exist "%JAVA_EXE%" goto execute
|
|
59
|
+
|
|
60
|
+
echo.
|
|
61
|
+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
62
|
+
echo.
|
|
63
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
64
|
+
echo location of your Java installation.
|
|
65
|
+
|
|
66
|
+
goto fail
|
|
67
|
+
|
|
68
|
+
:execute
|
|
69
|
+
@rem Setup the command line
|
|
70
|
+
|
|
71
|
+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@rem Execute Gradle
|
|
75
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
|
76
|
+
|
|
77
|
+
:end
|
|
78
|
+
@rem End local scope for the variables with windows NT shell
|
|
79
|
+
if %ERRORLEVEL% equ 0 goto mainEnd
|
|
80
|
+
|
|
81
|
+
:fail
|
|
82
|
+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
83
|
+
rem the _cmd.exe /c_ return code!
|
|
84
|
+
set EXIT_CODE=%ERRORLEVEL%
|
|
85
|
+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
|
86
|
+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
87
|
+
exit /b %EXIT_CODE%
|
|
88
|
+
|
|
89
|
+
:mainEnd
|
|
90
|
+
if "%OS%"=="Windows_NT" endlocal
|
|
91
|
+
|
|
92
|
+
:omega
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Add project specific ProGuard rules here.
|
|
2
|
+
# You can control the set of applied configuration files using the
|
|
3
|
+
# proguardFiles setting in build.gradle.
|
|
4
|
+
#
|
|
5
|
+
# For more details, see
|
|
6
|
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
7
|
+
|
|
8
|
+
# If your project uses WebView with JS, uncomment the following
|
|
9
|
+
# and specify the fully qualified class name to the JavaScript interface
|
|
10
|
+
# class:
|
|
11
|
+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
12
|
+
# public *;
|
|
13
|
+
#}
|
|
14
|
+
|
|
15
|
+
# Uncomment this to preserve the line number information for
|
|
16
|
+
# debugging stack traces.
|
|
17
|
+
#-keepattributes SourceFile,LineNumberTable
|
|
18
|
+
|
|
19
|
+
# If you keep the line number information, uncomment this to
|
|
20
|
+
# hide the original source file name.
|
|
21
|
+
#-renamesourcefileattribute SourceFile
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
package com.getcapacitor.android;
|
|
2
|
+
|
|
3
|
+
import static org.junit.Assert.*;
|
|
4
|
+
|
|
5
|
+
import android.content.Context;
|
|
6
|
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
|
7
|
+
import androidx.test.platform.app.InstrumentationRegistry;
|
|
8
|
+
import org.junit.Test;
|
|
9
|
+
import org.junit.runner.RunWith;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Instrumented test, which will execute on an Android device.
|
|
13
|
+
*
|
|
14
|
+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
15
|
+
*/
|
|
16
|
+
@RunWith(AndroidJUnit4.class)
|
|
17
|
+
public class ExampleInstrumentedTest {
|
|
18
|
+
|
|
19
|
+
@Test
|
|
20
|
+
public void useAppContext() throws Exception {
|
|
21
|
+
// Context of the app under test.
|
|
22
|
+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
|
23
|
+
|
|
24
|
+
assertEquals("com.getcapacitor.android", appContext.getPackageName());
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
package com.timozacherl.plugins.CapSiriShortcuts;
|
|
2
|
+
|
|
3
|
+
import com.getcapacitor.JSObject;
|
|
4
|
+
import com.getcapacitor.Plugin;
|
|
5
|
+
import com.getcapacitor.PluginCall;
|
|
6
|
+
import com.getcapacitor.PluginMethod;
|
|
7
|
+
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
8
|
+
|
|
9
|
+
@CapacitorPlugin(name = "SiriShortcuts")
|
|
10
|
+
public class SiriShortcuts extends Plugin {
|
|
11
|
+
|
|
12
|
+
@PluginMethod
|
|
13
|
+
public void donate(PluginCall call) {
|
|
14
|
+
String value = call.getString("value");
|
|
15
|
+
|
|
16
|
+
JSObject ret = new JSObject();
|
|
17
|
+
ret.put("value", value);
|
|
18
|
+
call.resolve(ret);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@PluginMethod
|
|
22
|
+
public void delete(PluginCall call) {
|
|
23
|
+
String value = call.getString("value");
|
|
24
|
+
|
|
25
|
+
JSObject ret = new JSObject();
|
|
26
|
+
ret.put("value", value);
|
|
27
|
+
call.resolve(ret);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@PluginMethod
|
|
31
|
+
public void deleteAll(PluginCall call) {
|
|
32
|
+
String value = call.getString("value");
|
|
33
|
+
|
|
34
|
+
JSObject ret = new JSObject();
|
|
35
|
+
ret.put("value", value);
|
|
36
|
+
call.resolve(ret);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
4
|
+
xmlns:tools="http://schemas.android.com/tools"
|
|
5
|
+
android:layout_width="match_parent"
|
|
6
|
+
android:layout_height="match_parent"
|
|
7
|
+
tools:context="com.getcapacitor.BridgeActivity"
|
|
8
|
+
>
|
|
9
|
+
|
|
10
|
+
<WebView
|
|
11
|
+
android:id="@+id/webview"
|
|
12
|
+
android:layout_width="fill_parent"
|
|
13
|
+
android:layout_height="fill_parent" />
|
|
14
|
+
|
|
15
|
+
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package com.getcapacitor;
|
|
2
|
+
|
|
3
|
+
import static org.junit.Assert.*;
|
|
4
|
+
|
|
5
|
+
import org.junit.Test;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Example local unit test, which will execute on the development machine (host).
|
|
9
|
+
*
|
|
10
|
+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
11
|
+
*/
|
|
12
|
+
public class ExampleUnitTest {
|
|
13
|
+
|
|
14
|
+
@Test
|
|
15
|
+
public void addition_isCorrect() throws Exception {
|
|
16
|
+
assertEquals(4, 2 + 2);
|
|
17
|
+
}
|
|
18
|
+
}
|
package/dist/docs.json
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "SiriShortcutsPlugin",
|
|
4
|
+
"slug": "sirishortcutsplugin",
|
|
5
|
+
"docs": "",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"methods": [
|
|
8
|
+
{
|
|
9
|
+
"name": "donate",
|
|
10
|
+
"signature": "(options: Options) => Promise<any>",
|
|
11
|
+
"parameters": [
|
|
12
|
+
{
|
|
13
|
+
"name": "options",
|
|
14
|
+
"docs": "Options to specify for the donation",
|
|
15
|
+
"type": "Options"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"returns": "Promise<any>",
|
|
19
|
+
"tags": [
|
|
20
|
+
{
|
|
21
|
+
"name": "since",
|
|
22
|
+
"text": "1.0.0"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "param",
|
|
26
|
+
"text": "options Options to specify for the donation"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"docs": "Donates the provided action to Siri/Shortcuts",
|
|
30
|
+
"complexTypes": [
|
|
31
|
+
"Options"
|
|
32
|
+
],
|
|
33
|
+
"slug": "donate"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "present",
|
|
37
|
+
"signature": "(options: Options) => Promise<any>",
|
|
38
|
+
"parameters": [
|
|
39
|
+
{
|
|
40
|
+
"name": "options",
|
|
41
|
+
"docs": "Options to specify for the donation",
|
|
42
|
+
"type": "Options"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"returns": "Promise<any>",
|
|
46
|
+
"tags": [
|
|
47
|
+
{
|
|
48
|
+
"name": "see",
|
|
49
|
+
"text": "https ://github.com/lovetodream/capacitor-plugin-siri-shortcuts/issues/3"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "since",
|
|
53
|
+
"text": "2.2.0"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "param",
|
|
57
|
+
"text": "options Options to specify for the donation"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"docs": "Presents a modal to the user to add the shortcut to siri and access it via voice",
|
|
61
|
+
"complexTypes": [
|
|
62
|
+
"Options"
|
|
63
|
+
],
|
|
64
|
+
"slug": "present"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "delete",
|
|
68
|
+
"signature": "(options: DeleteOptions) => Promise<void>",
|
|
69
|
+
"parameters": [
|
|
70
|
+
{
|
|
71
|
+
"name": "options",
|
|
72
|
+
"docs": "",
|
|
73
|
+
"type": "DeleteOptions"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"returns": "Promise<void>",
|
|
77
|
+
"tags": [
|
|
78
|
+
{
|
|
79
|
+
"name": "since",
|
|
80
|
+
"text": "2.1.0"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "param",
|
|
84
|
+
"text": "identifiers Persistent identifiers which should be deleted"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"docs": "Deletes the previous donations with the provided persistent identifiers",
|
|
88
|
+
"complexTypes": [
|
|
89
|
+
"DeleteOptions"
|
|
90
|
+
],
|
|
91
|
+
"slug": "delete"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "deleteAll",
|
|
95
|
+
"signature": "() => Promise<void>",
|
|
96
|
+
"parameters": [],
|
|
97
|
+
"returns": "Promise<void>",
|
|
98
|
+
"tags": [
|
|
99
|
+
{
|
|
100
|
+
"name": "since",
|
|
101
|
+
"text": "2.1.0"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"docs": "Delets all the previously donated activities",
|
|
105
|
+
"complexTypes": [],
|
|
106
|
+
"slug": "deleteall"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "addListener",
|
|
110
|
+
"signature": "(eventName: 'appLaunchBySiriShortcuts', listenerFunc: (shortcut: Shortcut) => void) => Promise<PluginListenerHandle>",
|
|
111
|
+
"parameters": [
|
|
112
|
+
{
|
|
113
|
+
"name": "eventName",
|
|
114
|
+
"docs": "Name of the event",
|
|
115
|
+
"type": "'appLaunchBySiriShortcuts'"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "listenerFunc",
|
|
119
|
+
"docs": "Function to execute when listener gets notified",
|
|
120
|
+
"type": "(shortcut: Shortcut) => void"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
124
|
+
"tags": [
|
|
125
|
+
{
|
|
126
|
+
"name": "since",
|
|
127
|
+
"text": "2.0.1"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "param",
|
|
131
|
+
"text": "eventName Name of the event"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "param",
|
|
135
|
+
"text": "listenerFunc Function to execute when listener gets notified"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"docs": "Listens to events associated with Siri Shortcuts\nand notifies the listenerFunc if a Shortcuts has been executed.",
|
|
139
|
+
"complexTypes": [
|
|
140
|
+
"PluginListenerHandle",
|
|
141
|
+
"Shortcut"
|
|
142
|
+
],
|
|
143
|
+
"slug": "addlistenerapplaunchbysirishortcuts"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "removeAllListeners",
|
|
147
|
+
"signature": "() => Promise<void>",
|
|
148
|
+
"parameters": [],
|
|
149
|
+
"returns": "Promise<void>",
|
|
150
|
+
"tags": [
|
|
151
|
+
{
|
|
152
|
+
"name": "since",
|
|
153
|
+
"text": "2.0.1"
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"docs": "Remove all listeners for this plugin.",
|
|
157
|
+
"complexTypes": [],
|
|
158
|
+
"slug": "removealllisteners"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"properties": []
|
|
162
|
+
},
|
|
163
|
+
"interfaces": [
|
|
164
|
+
{
|
|
165
|
+
"name": "Options",
|
|
166
|
+
"slug": "options",
|
|
167
|
+
"docs": "Options to specify for the donation",
|
|
168
|
+
"tags": [],
|
|
169
|
+
"methods": [],
|
|
170
|
+
"properties": [
|
|
171
|
+
{
|
|
172
|
+
"name": "persistentIdentifier",
|
|
173
|
+
"tags": [],
|
|
174
|
+
"docs": "Specify an identifier to uniquely identify the shortcut,\nin order to be able to remove it",
|
|
175
|
+
"complexTypes": [],
|
|
176
|
+
"type": "string"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "title",
|
|
180
|
+
"tags": [],
|
|
181
|
+
"docs": "Specify a title for the shortcut, which is visible to the\nuser as the name of the shortcut",
|
|
182
|
+
"complexTypes": [],
|
|
183
|
+
"type": "string"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"name": "userInfo",
|
|
187
|
+
"tags": [],
|
|
188
|
+
"docs": "Provide a key-value object that contains information about\nthe shortcut, this will be returned in the getActivatedShortcut\nmethod. It is not possible to use the persistentIdentifier key,\nit is used internally",
|
|
189
|
+
"complexTypes": [
|
|
190
|
+
"UserInfo"
|
|
191
|
+
],
|
|
192
|
+
"type": "UserInfo"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"name": "suggestedInvocationPhrase",
|
|
196
|
+
"tags": [],
|
|
197
|
+
"docs": "Specify the phrase to give the user some inspiration\non what the shortcut to call",
|
|
198
|
+
"complexTypes": [],
|
|
199
|
+
"type": "string | undefined"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"name": "isEligibleForSearch",
|
|
203
|
+
"tags": [],
|
|
204
|
+
"docs": "This value defaults to true, set this value to make\nit searchable in Siri",
|
|
205
|
+
"complexTypes": [],
|
|
206
|
+
"type": "boolean | undefined"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"name": "isEligibleForPrediction",
|
|
210
|
+
"tags": [],
|
|
211
|
+
"docs": "This value defaults to true, set this value to set whether\nthe shortcut eligible for prediction",
|
|
212
|
+
"complexTypes": [],
|
|
213
|
+
"type": "boolean | undefined"
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "UserInfo",
|
|
219
|
+
"slug": "userinfo",
|
|
220
|
+
"docs": "",
|
|
221
|
+
"tags": [],
|
|
222
|
+
"methods": [],
|
|
223
|
+
"properties": []
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"name": "DeleteOptions",
|
|
227
|
+
"slug": "deleteoptions",
|
|
228
|
+
"docs": "Options to specify for a deletion",
|
|
229
|
+
"tags": [],
|
|
230
|
+
"methods": [],
|
|
231
|
+
"properties": [
|
|
232
|
+
{
|
|
233
|
+
"name": "identifiers",
|
|
234
|
+
"tags": [],
|
|
235
|
+
"docs": "Array of persistent identifiers which should be deleted",
|
|
236
|
+
"complexTypes": [],
|
|
237
|
+
"type": "string[]"
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"name": "PluginListenerHandle",
|
|
243
|
+
"slug": "pluginlistenerhandle",
|
|
244
|
+
"docs": "",
|
|
245
|
+
"tags": [],
|
|
246
|
+
"methods": [],
|
|
247
|
+
"properties": [
|
|
248
|
+
{
|
|
249
|
+
"name": "remove",
|
|
250
|
+
"tags": [],
|
|
251
|
+
"docs": "",
|
|
252
|
+
"complexTypes": [],
|
|
253
|
+
"type": "() => Promise<void>"
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "Shortcut",
|
|
259
|
+
"slug": "shortcut",
|
|
260
|
+
"docs": "Object which will be returned by the listener which\ncontains the persistent identifier and the userinfo\nof a shortcut",
|
|
261
|
+
"tags": [],
|
|
262
|
+
"methods": [],
|
|
263
|
+
"properties": [
|
|
264
|
+
{
|
|
265
|
+
"name": "persistentIdentifier",
|
|
266
|
+
"tags": [],
|
|
267
|
+
"docs": "",
|
|
268
|
+
"complexTypes": [
|
|
269
|
+
"Options"
|
|
270
|
+
],
|
|
271
|
+
"type": "string"
|
|
272
|
+
}
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
],
|
|
276
|
+
"enums": [],
|
|
277
|
+
"typeAliases": [],
|
|
278
|
+
"pluginConfigs": []
|
|
279
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
|
+
export interface SiriShortcutsPlugin {
|
|
3
|
+
/**
|
|
4
|
+
* Donates the provided action to Siri/Shortcuts
|
|
5
|
+
*
|
|
6
|
+
* @since 1.0.0
|
|
7
|
+
*
|
|
8
|
+
* @param {Options} options Options to specify for the donation
|
|
9
|
+
*/
|
|
10
|
+
donate(options: Options): Promise<any>;
|
|
11
|
+
/**
|
|
12
|
+
* Presents a modal to the user to add the shortcut to siri and access it via voice
|
|
13
|
+
*
|
|
14
|
+
* @see https://github.com/lovetodream/capacitor-plugin-siri-shortcuts/issues/3
|
|
15
|
+
*
|
|
16
|
+
* @since 2.2.0
|
|
17
|
+
*
|
|
18
|
+
* @param {Options} options Options to specify for the donation
|
|
19
|
+
*/
|
|
20
|
+
present(options: Options): Promise<any>;
|
|
21
|
+
/**
|
|
22
|
+
* Deletes the previous donations with the provided persistent identifiers
|
|
23
|
+
*
|
|
24
|
+
* @since 2.1.0
|
|
25
|
+
*
|
|
26
|
+
* @param {DeleteOptions} identifiers Persistent identifiers which should be deleted
|
|
27
|
+
*/
|
|
28
|
+
delete(options: DeleteOptions): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Delets all the previously donated activities
|
|
31
|
+
*
|
|
32
|
+
* @since 2.1.0
|
|
33
|
+
*/
|
|
34
|
+
deleteAll(): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Listens to events associated with Siri Shortcuts
|
|
37
|
+
* and notifies the listenerFunc if a Shortcuts has been executed.
|
|
38
|
+
*
|
|
39
|
+
* @since 2.0.1
|
|
40
|
+
*
|
|
41
|
+
* @param eventName Name of the event
|
|
42
|
+
* @param listenerFunc Function to execute when listener gets notified
|
|
43
|
+
*/
|
|
44
|
+
addListener(eventName: 'appLaunchBySiriShortcuts', listenerFunc: (shortcut: Shortcut) => void): Promise<PluginListenerHandle>;
|
|
45
|
+
/**
|
|
46
|
+
* Remove all listeners for this plugin.
|
|
47
|
+
*
|
|
48
|
+
* @since 2.0.1
|
|
49
|
+
*/
|
|
50
|
+
removeAllListeners(): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
export interface UserInfo {
|
|
53
|
+
/**
|
|
54
|
+
* Anything except persistentIdentifier, because the
|
|
55
|
+
* persistentIdentifier will be added automatically!
|
|
56
|
+
*/
|
|
57
|
+
[key: string]: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Object which will be returned by the listener which
|
|
61
|
+
* contains the persistent identifier and the userinfo
|
|
62
|
+
* of a shortcut
|
|
63
|
+
*/
|
|
64
|
+
export interface Shortcut extends UserInfo {
|
|
65
|
+
persistentIdentifier: Options['persistentIdentifier'];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Options to specify for the donation
|
|
69
|
+
*/
|
|
70
|
+
export interface Options {
|
|
71
|
+
/**
|
|
72
|
+
* Specify an identifier to uniquely identify the shortcut,
|
|
73
|
+
* in order to be able to remove it
|
|
74
|
+
*/
|
|
75
|
+
persistentIdentifier: string;
|
|
76
|
+
/**
|
|
77
|
+
* Specify a title for the shortcut, which is visible to the
|
|
78
|
+
* user as the name of the shortcut
|
|
79
|
+
*/
|
|
80
|
+
title: string;
|
|
81
|
+
/**
|
|
82
|
+
* Provide a key-value object that contains information about
|
|
83
|
+
* the shortcut, this will be returned in the getActivatedShortcut
|
|
84
|
+
* method. It is not possible to use the persistentIdentifier key,
|
|
85
|
+
* it is used internally
|
|
86
|
+
*/
|
|
87
|
+
userInfo?: UserInfo;
|
|
88
|
+
/**
|
|
89
|
+
* Specify the phrase to give the user some inspiration
|
|
90
|
+
* on what the shortcut to call
|
|
91
|
+
*/
|
|
92
|
+
suggestedInvocationPhrase?: string;
|
|
93
|
+
/**
|
|
94
|
+
* This value defaults to true, set this value to make
|
|
95
|
+
* it searchable in Siri
|
|
96
|
+
*/
|
|
97
|
+
isEligibleForSearch?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* This value defaults to true, set this value to set whether
|
|
100
|
+
* the shortcut eligible for prediction
|
|
101
|
+
*/
|
|
102
|
+
isEligibleForPrediction?: boolean;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Options to specify for a deletion
|
|
106
|
+
*/
|
|
107
|
+
export interface DeleteOptions {
|
|
108
|
+
/**
|
|
109
|
+
* Array of persistent identifiers which should be deleted
|
|
110
|
+
*/
|
|
111
|
+
identifiers: string[];
|
|
112
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,aAAa,GAAG,cAAc,CAAsB,eAAe,CAAC,CAAC;AAE3E,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var core = require('@capacitor/core');
|
|
6
|
+
|
|
7
|
+
const SiriShortcuts = core.registerPlugin('SiriShortcuts');
|
|
8
|
+
|
|
9
|
+
exports.SiriShortcuts = SiriShortcuts;
|
|
10
|
+
//# sourceMappingURL=plugin.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst SiriShortcuts = registerPlugin('SiriShortcuts');\nexport * from './definitions';\nexport { SiriShortcuts };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":";;;;;;AACK,MAAC,aAAa,GAAGA,mBAAc,CAAC,eAAe;;;;"}
|