@capgo/capacitor-watch 8.0.2
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/CapgoCapacitorWatch.podspec +17 -0
- package/LICENSE +373 -0
- package/Package.swift +28 -0
- package/README.md +848 -0
- package/android/build.gradle +58 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/app/capgo/capacitor/watch/CapgoWatchPlugin.java +61 -0
- package/dist/docs.json +847 -0
- package/dist/esm/definitions.d.ts +371 -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 +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +12 -0
- package/dist/esm/web.js +28 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +42 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +45 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/CapgoWatchPlugin/CapgoWatchPlugin.swift +280 -0
- package/ios/Tests/CapgoWatchPluginTests/CapgoWatchPluginTests.swift +11 -0
- package/package.json +88 -0
package/dist/docs.json
ADDED
|
@@ -0,0 +1,847 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "CapgoWatchPlugin",
|
|
4
|
+
"slug": "capgowatchplugin",
|
|
5
|
+
"docs": "Apple Watch communication plugin for Capacitor.\nProvides bidirectional messaging between iPhone and Apple Watch using WatchConnectivity.",
|
|
6
|
+
"tags": [
|
|
7
|
+
{
|
|
8
|
+
"text": "8.0.0",
|
|
9
|
+
"name": "since"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"methods": [
|
|
13
|
+
{
|
|
14
|
+
"name": "sendMessage",
|
|
15
|
+
"signature": "(options: SendMessageOptions) => Promise<void>",
|
|
16
|
+
"parameters": [
|
|
17
|
+
{
|
|
18
|
+
"name": "options",
|
|
19
|
+
"docs": "- The message options",
|
|
20
|
+
"type": "SendMessageOptions"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"returns": "Promise<void>",
|
|
24
|
+
"tags": [
|
|
25
|
+
{
|
|
26
|
+
"name": "param",
|
|
27
|
+
"text": "options - The message options"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "returns",
|
|
31
|
+
"text": "Promise that resolves when the message is sent"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "throws",
|
|
35
|
+
"text": "Error if the watch is not reachable or session is not active"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "since",
|
|
39
|
+
"text": "8.0.0"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "example",
|
|
43
|
+
"text": "```typescript\nawait CapgoWatch.sendMessage({\n data: { action: 'refresh', timestamp: Date.now() }\n});\n```"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"docs": "Send an interactive message to the watch.\nThe watch must be reachable for this to succeed.\nUse this for time-sensitive, interactive communication.",
|
|
47
|
+
"complexTypes": [
|
|
48
|
+
"SendMessageOptions"
|
|
49
|
+
],
|
|
50
|
+
"slug": "sendmessage"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "updateApplicationContext",
|
|
54
|
+
"signature": "(options: UpdateContextOptions) => Promise<void>",
|
|
55
|
+
"parameters": [
|
|
56
|
+
{
|
|
57
|
+
"name": "options",
|
|
58
|
+
"docs": "- The context options",
|
|
59
|
+
"type": "UpdateContextOptions"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"returns": "Promise<void>",
|
|
63
|
+
"tags": [
|
|
64
|
+
{
|
|
65
|
+
"name": "param",
|
|
66
|
+
"text": "options - The context options"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "returns",
|
|
70
|
+
"text": "Promise that resolves when the context is updated"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "throws",
|
|
74
|
+
"text": "Error if session is not active"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "since",
|
|
78
|
+
"text": "8.0.0"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "example",
|
|
82
|
+
"text": "```typescript\nawait CapgoWatch.updateApplicationContext({\n context: { theme: 'dark', lastSync: Date.now() }\n});\n```"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"docs": "Update the application context shared with the watch.\nOnly the latest context is kept - this overwrites any previous context.\nUse this for syncing app state that the watch needs to display.",
|
|
86
|
+
"complexTypes": [
|
|
87
|
+
"UpdateContextOptions"
|
|
88
|
+
],
|
|
89
|
+
"slug": "updateapplicationcontext"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "transferUserInfo",
|
|
93
|
+
"signature": "(options: TransferUserInfoOptions) => Promise<void>",
|
|
94
|
+
"parameters": [
|
|
95
|
+
{
|
|
96
|
+
"name": "options",
|
|
97
|
+
"docs": "- The user info options",
|
|
98
|
+
"type": "TransferUserInfoOptions"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"returns": "Promise<void>",
|
|
102
|
+
"tags": [
|
|
103
|
+
{
|
|
104
|
+
"name": "param",
|
|
105
|
+
"text": "options - The user info options"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "returns",
|
|
109
|
+
"text": "Promise that resolves when the transfer is queued"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "throws",
|
|
113
|
+
"text": "Error if session is not active"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "since",
|
|
117
|
+
"text": "8.0.0"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "example",
|
|
121
|
+
"text": "```typescript\nawait CapgoWatch.transferUserInfo({\n userInfo: { recordId: '123', action: 'created' }\n});\n```"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"docs": "Transfer user info to the watch.\nTransfers are queued and delivered in order, even if the watch is not currently reachable.\nUse this for important data that must be delivered reliably.",
|
|
125
|
+
"complexTypes": [
|
|
126
|
+
"TransferUserInfoOptions"
|
|
127
|
+
],
|
|
128
|
+
"slug": "transferuserinfo"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "replyToMessage",
|
|
132
|
+
"signature": "(options: ReplyMessageOptions) => Promise<void>",
|
|
133
|
+
"parameters": [
|
|
134
|
+
{
|
|
135
|
+
"name": "options",
|
|
136
|
+
"docs": "- The reply options including the callbackId",
|
|
137
|
+
"type": "ReplyMessageOptions"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"returns": "Promise<void>",
|
|
141
|
+
"tags": [
|
|
142
|
+
{
|
|
143
|
+
"name": "param",
|
|
144
|
+
"text": "options - The reply options including the callbackId"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "returns",
|
|
148
|
+
"text": "Promise that resolves when the reply is sent"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "throws",
|
|
152
|
+
"text": "Error if the callback ID is invalid or session is not active"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "since",
|
|
156
|
+
"text": "8.0.0"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "example",
|
|
160
|
+
"text": "```typescript\nCapgoWatch.addListener('messageReceivedWithReply', async (event) => {\n const result = await processRequest(event.message);\n await CapgoWatch.replyToMessage({\n callbackId: event.callbackId,\n data: { result }\n });\n});\n```"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"docs": "Reply to a message from the watch that requested a reply.\nUse this in response to the messageReceivedWithReply event.",
|
|
164
|
+
"complexTypes": [
|
|
165
|
+
"ReplyMessageOptions"
|
|
166
|
+
],
|
|
167
|
+
"slug": "replytomessage"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"name": "getInfo",
|
|
171
|
+
"signature": "() => Promise<WatchInfo>",
|
|
172
|
+
"parameters": [],
|
|
173
|
+
"returns": "Promise<WatchInfo>",
|
|
174
|
+
"tags": [
|
|
175
|
+
{
|
|
176
|
+
"name": "returns",
|
|
177
|
+
"text": "Promise that resolves with watch connectivity info"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "since",
|
|
181
|
+
"text": "8.0.0"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "example",
|
|
185
|
+
"text": "```typescript\nconst info = await CapgoWatch.getInfo();\nif (info.isReachable) {\n await CapgoWatch.sendMessage({ data: { ping: true } });\n}\n```"
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
"docs": "Get information about the watch connectivity status.",
|
|
189
|
+
"complexTypes": [
|
|
190
|
+
"WatchInfo"
|
|
191
|
+
],
|
|
192
|
+
"slug": "getinfo"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"name": "getPluginVersion",
|
|
196
|
+
"signature": "() => Promise<{ version: string; }>",
|
|
197
|
+
"parameters": [],
|
|
198
|
+
"returns": "Promise<{ version: string; }>",
|
|
199
|
+
"tags": [
|
|
200
|
+
{
|
|
201
|
+
"name": "returns",
|
|
202
|
+
"text": "Promise that resolves with the plugin version"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "since",
|
|
206
|
+
"text": "8.0.0"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"name": "example",
|
|
210
|
+
"text": "```typescript\nconst { version } = await CapgoWatch.getPluginVersion();\nconsole.log('Plugin version:', version);\n```"
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"docs": "Get the native Capacitor plugin version.",
|
|
214
|
+
"complexTypes": [],
|
|
215
|
+
"slug": "getpluginversion"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "addListener",
|
|
219
|
+
"signature": "(eventName: 'messageReceived', listenerFunc: (event: MessageReceivedEvent) => void) => Promise<PluginListenerHandle>",
|
|
220
|
+
"parameters": [
|
|
221
|
+
{
|
|
222
|
+
"name": "eventName",
|
|
223
|
+
"docs": "- The event name",
|
|
224
|
+
"type": "'messageReceived'"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"name": "listenerFunc",
|
|
228
|
+
"docs": "- Callback function",
|
|
229
|
+
"type": "(event: MessageReceivedEvent) => void"
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
233
|
+
"tags": [
|
|
234
|
+
{
|
|
235
|
+
"name": "param",
|
|
236
|
+
"text": "eventName - The event name"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"name": "param",
|
|
240
|
+
"text": "listenerFunc - Callback function"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"name": "returns",
|
|
244
|
+
"text": "Handle to remove the listener"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"name": "since",
|
|
248
|
+
"text": "8.0.0"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"name": "example",
|
|
252
|
+
"text": "```typescript\nconst handle = await CapgoWatch.addListener('messageReceived', (event) => {\n console.log('Message from watch:', event.message);\n});\n// Later: handle.remove();\n```"
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
"docs": "Listen for messages received from the watch.",
|
|
256
|
+
"complexTypes": [
|
|
257
|
+
"PluginListenerHandle",
|
|
258
|
+
"MessageReceivedEvent"
|
|
259
|
+
],
|
|
260
|
+
"slug": "addlistenermessagereceived-"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "addListener",
|
|
264
|
+
"signature": "(eventName: 'messageReceivedWithReply', listenerFunc: (event: MessageReceivedWithReplyEvent) => void) => Promise<PluginListenerHandle>",
|
|
265
|
+
"parameters": [
|
|
266
|
+
{
|
|
267
|
+
"name": "eventName",
|
|
268
|
+
"docs": "- The event name",
|
|
269
|
+
"type": "'messageReceivedWithReply'"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "listenerFunc",
|
|
273
|
+
"docs": "- Callback function",
|
|
274
|
+
"type": "(event: MessageReceivedWithReplyEvent) => void"
|
|
275
|
+
}
|
|
276
|
+
],
|
|
277
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
278
|
+
"tags": [
|
|
279
|
+
{
|
|
280
|
+
"name": "param",
|
|
281
|
+
"text": "eventName - The event name"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "param",
|
|
285
|
+
"text": "listenerFunc - Callback function"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "returns",
|
|
289
|
+
"text": "Handle to remove the listener"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"name": "since",
|
|
293
|
+
"text": "8.0.0"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"name": "example",
|
|
297
|
+
"text": "```typescript\nawait CapgoWatch.addListener('messageReceivedWithReply', async (event) => {\n const response = await handleRequest(event.message);\n await CapgoWatch.replyToMessage({\n callbackId: event.callbackId,\n data: response\n });\n});\n```"
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"docs": "Listen for messages from the watch that require a reply.",
|
|
301
|
+
"complexTypes": [
|
|
302
|
+
"PluginListenerHandle",
|
|
303
|
+
"MessageReceivedWithReplyEvent"
|
|
304
|
+
],
|
|
305
|
+
"slug": "addlistenermessagereceivedwithreply-"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"name": "addListener",
|
|
309
|
+
"signature": "(eventName: 'applicationContextReceived', listenerFunc: (event: ContextReceivedEvent) => void) => Promise<PluginListenerHandle>",
|
|
310
|
+
"parameters": [
|
|
311
|
+
{
|
|
312
|
+
"name": "eventName",
|
|
313
|
+
"docs": "- The event name",
|
|
314
|
+
"type": "'applicationContextReceived'"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"name": "listenerFunc",
|
|
318
|
+
"docs": "- Callback function",
|
|
319
|
+
"type": "(event: ContextReceivedEvent) => void"
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
323
|
+
"tags": [
|
|
324
|
+
{
|
|
325
|
+
"name": "param",
|
|
326
|
+
"text": "eventName - The event name"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"name": "param",
|
|
330
|
+
"text": "listenerFunc - Callback function"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"name": "returns",
|
|
334
|
+
"text": "Handle to remove the listener"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"name": "since",
|
|
338
|
+
"text": "8.0.0"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"name": "example",
|
|
342
|
+
"text": "```typescript\nawait CapgoWatch.addListener('applicationContextReceived', (event) => {\n console.log('Context from watch:', event.context);\n});\n```"
|
|
343
|
+
}
|
|
344
|
+
],
|
|
345
|
+
"docs": "Listen for application context updates from the watch.",
|
|
346
|
+
"complexTypes": [
|
|
347
|
+
"PluginListenerHandle",
|
|
348
|
+
"ContextReceivedEvent"
|
|
349
|
+
],
|
|
350
|
+
"slug": "addlistenerapplicationcontextreceived-"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"name": "addListener",
|
|
354
|
+
"signature": "(eventName: 'userInfoReceived', listenerFunc: (event: UserInfoReceivedEvent) => void) => Promise<PluginListenerHandle>",
|
|
355
|
+
"parameters": [
|
|
356
|
+
{
|
|
357
|
+
"name": "eventName",
|
|
358
|
+
"docs": "- The event name",
|
|
359
|
+
"type": "'userInfoReceived'"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"name": "listenerFunc",
|
|
363
|
+
"docs": "- Callback function",
|
|
364
|
+
"type": "(event: UserInfoReceivedEvent) => void"
|
|
365
|
+
}
|
|
366
|
+
],
|
|
367
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
368
|
+
"tags": [
|
|
369
|
+
{
|
|
370
|
+
"name": "param",
|
|
371
|
+
"text": "eventName - The event name"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"name": "param",
|
|
375
|
+
"text": "listenerFunc - Callback function"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"name": "returns",
|
|
379
|
+
"text": "Handle to remove the listener"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"name": "since",
|
|
383
|
+
"text": "8.0.0"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"name": "example",
|
|
387
|
+
"text": "```typescript\nawait CapgoWatch.addListener('userInfoReceived', (event) => {\n console.log('User info from watch:', event.userInfo);\n});\n```"
|
|
388
|
+
}
|
|
389
|
+
],
|
|
390
|
+
"docs": "Listen for user info transfers from the watch.",
|
|
391
|
+
"complexTypes": [
|
|
392
|
+
"PluginListenerHandle",
|
|
393
|
+
"UserInfoReceivedEvent"
|
|
394
|
+
],
|
|
395
|
+
"slug": "addlisteneruserinforeceived-"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"name": "addListener",
|
|
399
|
+
"signature": "(eventName: 'reachabilityChanged', listenerFunc: (event: ReachabilityChangedEvent) => void) => Promise<PluginListenerHandle>",
|
|
400
|
+
"parameters": [
|
|
401
|
+
{
|
|
402
|
+
"name": "eventName",
|
|
403
|
+
"docs": "- The event name",
|
|
404
|
+
"type": "'reachabilityChanged'"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"name": "listenerFunc",
|
|
408
|
+
"docs": "- Callback function",
|
|
409
|
+
"type": "(event: ReachabilityChangedEvent) => void"
|
|
410
|
+
}
|
|
411
|
+
],
|
|
412
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
413
|
+
"tags": [
|
|
414
|
+
{
|
|
415
|
+
"name": "param",
|
|
416
|
+
"text": "eventName - The event name"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"name": "param",
|
|
420
|
+
"text": "listenerFunc - Callback function"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"name": "returns",
|
|
424
|
+
"text": "Handle to remove the listener"
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"name": "since",
|
|
428
|
+
"text": "8.0.0"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"name": "example",
|
|
432
|
+
"text": "```typescript\nawait CapgoWatch.addListener('reachabilityChanged', (event) => {\n console.log('Watch reachable:', event.isReachable);\n});\n```"
|
|
433
|
+
}
|
|
434
|
+
],
|
|
435
|
+
"docs": "Listen for watch reachability changes.",
|
|
436
|
+
"complexTypes": [
|
|
437
|
+
"PluginListenerHandle",
|
|
438
|
+
"ReachabilityChangedEvent"
|
|
439
|
+
],
|
|
440
|
+
"slug": "addlistenerreachabilitychanged-"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"name": "addListener",
|
|
444
|
+
"signature": "(eventName: 'activationStateChanged', listenerFunc: (event: ActivationStateChangedEvent) => void) => Promise<PluginListenerHandle>",
|
|
445
|
+
"parameters": [
|
|
446
|
+
{
|
|
447
|
+
"name": "eventName",
|
|
448
|
+
"docs": "- The event name",
|
|
449
|
+
"type": "'activationStateChanged'"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"name": "listenerFunc",
|
|
453
|
+
"docs": "- Callback function",
|
|
454
|
+
"type": "(event: ActivationStateChangedEvent) => void"
|
|
455
|
+
}
|
|
456
|
+
],
|
|
457
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
458
|
+
"tags": [
|
|
459
|
+
{
|
|
460
|
+
"name": "param",
|
|
461
|
+
"text": "eventName - The event name"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"name": "param",
|
|
465
|
+
"text": "listenerFunc - Callback function"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"name": "returns",
|
|
469
|
+
"text": "Handle to remove the listener"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"name": "since",
|
|
473
|
+
"text": "8.0.0"
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"name": "example",
|
|
477
|
+
"text": "```typescript\nawait CapgoWatch.addListener('activationStateChanged', (event) => {\n console.log('Activation state:', event.state);\n});\n```"
|
|
478
|
+
}
|
|
479
|
+
],
|
|
480
|
+
"docs": "Listen for session activation state changes.",
|
|
481
|
+
"complexTypes": [
|
|
482
|
+
"PluginListenerHandle",
|
|
483
|
+
"ActivationStateChangedEvent"
|
|
484
|
+
],
|
|
485
|
+
"slug": "addlisteneractivationstatechanged-"
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"name": "removeAllListeners",
|
|
489
|
+
"signature": "() => Promise<void>",
|
|
490
|
+
"parameters": [],
|
|
491
|
+
"returns": "Promise<void>",
|
|
492
|
+
"tags": [
|
|
493
|
+
{
|
|
494
|
+
"name": "since",
|
|
495
|
+
"text": "8.0.0"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"name": "example",
|
|
499
|
+
"text": "```typescript\nawait CapgoWatch.removeAllListeners();\n```"
|
|
500
|
+
}
|
|
501
|
+
],
|
|
502
|
+
"docs": "Remove all listeners for this plugin.",
|
|
503
|
+
"complexTypes": [],
|
|
504
|
+
"slug": "removealllisteners"
|
|
505
|
+
}
|
|
506
|
+
],
|
|
507
|
+
"properties": []
|
|
508
|
+
},
|
|
509
|
+
"interfaces": [
|
|
510
|
+
{
|
|
511
|
+
"name": "SendMessageOptions",
|
|
512
|
+
"slug": "sendmessageoptions",
|
|
513
|
+
"docs": "Options for sending a message to the watch.",
|
|
514
|
+
"tags": [
|
|
515
|
+
{
|
|
516
|
+
"text": "8.0.0",
|
|
517
|
+
"name": "since"
|
|
518
|
+
}
|
|
519
|
+
],
|
|
520
|
+
"methods": [],
|
|
521
|
+
"properties": [
|
|
522
|
+
{
|
|
523
|
+
"name": "data",
|
|
524
|
+
"tags": [],
|
|
525
|
+
"docs": "The data to send to the watch.\nMust be serializable (string, number, boolean, arrays, or nested objects).",
|
|
526
|
+
"complexTypes": [
|
|
527
|
+
"WatchMessageData"
|
|
528
|
+
],
|
|
529
|
+
"type": "WatchMessageData"
|
|
530
|
+
}
|
|
531
|
+
]
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"name": "UpdateContextOptions",
|
|
535
|
+
"slug": "updatecontextoptions",
|
|
536
|
+
"docs": "Options for updating the application context.",
|
|
537
|
+
"tags": [
|
|
538
|
+
{
|
|
539
|
+
"text": "8.0.0",
|
|
540
|
+
"name": "since"
|
|
541
|
+
}
|
|
542
|
+
],
|
|
543
|
+
"methods": [],
|
|
544
|
+
"properties": [
|
|
545
|
+
{
|
|
546
|
+
"name": "context",
|
|
547
|
+
"tags": [],
|
|
548
|
+
"docs": "The context data to sync with the watch.\nOnly the latest context is kept - previous values are overwritten.",
|
|
549
|
+
"complexTypes": [
|
|
550
|
+
"WatchMessageData"
|
|
551
|
+
],
|
|
552
|
+
"type": "WatchMessageData"
|
|
553
|
+
}
|
|
554
|
+
]
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
"name": "TransferUserInfoOptions",
|
|
558
|
+
"slug": "transferuserinfooptions",
|
|
559
|
+
"docs": "Options for transferring user info.",
|
|
560
|
+
"tags": [
|
|
561
|
+
{
|
|
562
|
+
"text": "8.0.0",
|
|
563
|
+
"name": "since"
|
|
564
|
+
}
|
|
565
|
+
],
|
|
566
|
+
"methods": [],
|
|
567
|
+
"properties": [
|
|
568
|
+
{
|
|
569
|
+
"name": "userInfo",
|
|
570
|
+
"tags": [],
|
|
571
|
+
"docs": "The user info data to transfer.\nTransfers are queued and delivered in order.",
|
|
572
|
+
"complexTypes": [
|
|
573
|
+
"WatchMessageData"
|
|
574
|
+
],
|
|
575
|
+
"type": "WatchMessageData"
|
|
576
|
+
}
|
|
577
|
+
]
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
"name": "ReplyMessageOptions",
|
|
581
|
+
"slug": "replymessageoptions",
|
|
582
|
+
"docs": "Options for replying to a message from the watch.",
|
|
583
|
+
"tags": [
|
|
584
|
+
{
|
|
585
|
+
"text": "8.0.0",
|
|
586
|
+
"name": "since"
|
|
587
|
+
}
|
|
588
|
+
],
|
|
589
|
+
"methods": [],
|
|
590
|
+
"properties": [
|
|
591
|
+
{
|
|
592
|
+
"name": "callbackId",
|
|
593
|
+
"tags": [],
|
|
594
|
+
"docs": "The callback ID received in the messageReceivedWithReply event.",
|
|
595
|
+
"complexTypes": [],
|
|
596
|
+
"type": "string"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"name": "data",
|
|
600
|
+
"tags": [],
|
|
601
|
+
"docs": "The reply data to send back to the watch.",
|
|
602
|
+
"complexTypes": [
|
|
603
|
+
"WatchMessageData"
|
|
604
|
+
],
|
|
605
|
+
"type": "WatchMessageData"
|
|
606
|
+
}
|
|
607
|
+
]
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"name": "WatchInfo",
|
|
611
|
+
"slug": "watchinfo",
|
|
612
|
+
"docs": "Information about Watch connectivity status.",
|
|
613
|
+
"tags": [
|
|
614
|
+
{
|
|
615
|
+
"text": "8.0.0",
|
|
616
|
+
"name": "since"
|
|
617
|
+
}
|
|
618
|
+
],
|
|
619
|
+
"methods": [],
|
|
620
|
+
"properties": [
|
|
621
|
+
{
|
|
622
|
+
"name": "isSupported",
|
|
623
|
+
"tags": [],
|
|
624
|
+
"docs": "Whether WatchConnectivity is supported on this device.\nAlways false on iPad, web, and Android.",
|
|
625
|
+
"complexTypes": [],
|
|
626
|
+
"type": "boolean"
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
"name": "isPaired",
|
|
630
|
+
"tags": [],
|
|
631
|
+
"docs": "Whether an Apple Watch is paired with this iPhone.",
|
|
632
|
+
"complexTypes": [],
|
|
633
|
+
"type": "boolean"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"name": "isWatchAppInstalled",
|
|
637
|
+
"tags": [],
|
|
638
|
+
"docs": "Whether the paired watch has the companion app installed.",
|
|
639
|
+
"complexTypes": [],
|
|
640
|
+
"type": "boolean"
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
"name": "isReachable",
|
|
644
|
+
"tags": [],
|
|
645
|
+
"docs": "Whether the watch is currently reachable for immediate messaging.",
|
|
646
|
+
"complexTypes": [],
|
|
647
|
+
"type": "boolean"
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
"name": "activationState",
|
|
651
|
+
"tags": [],
|
|
652
|
+
"docs": "The current activation state of the WCSession.\n0 = notActivated, 1 = inactive, 2 = activated",
|
|
653
|
+
"complexTypes": [],
|
|
654
|
+
"type": "number"
|
|
655
|
+
}
|
|
656
|
+
]
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
"name": "PluginListenerHandle",
|
|
660
|
+
"slug": "pluginlistenerhandle",
|
|
661
|
+
"docs": "",
|
|
662
|
+
"tags": [],
|
|
663
|
+
"methods": [],
|
|
664
|
+
"properties": [
|
|
665
|
+
{
|
|
666
|
+
"name": "remove",
|
|
667
|
+
"tags": [],
|
|
668
|
+
"docs": "",
|
|
669
|
+
"complexTypes": [],
|
|
670
|
+
"type": "() => Promise<void>"
|
|
671
|
+
}
|
|
672
|
+
]
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
"name": "MessageReceivedEvent",
|
|
676
|
+
"slug": "messagereceivedevent",
|
|
677
|
+
"docs": "Event data for received messages.",
|
|
678
|
+
"tags": [
|
|
679
|
+
{
|
|
680
|
+
"text": "8.0.0",
|
|
681
|
+
"name": "since"
|
|
682
|
+
}
|
|
683
|
+
],
|
|
684
|
+
"methods": [],
|
|
685
|
+
"properties": [
|
|
686
|
+
{
|
|
687
|
+
"name": "message",
|
|
688
|
+
"tags": [],
|
|
689
|
+
"docs": "The message data received from the watch.",
|
|
690
|
+
"complexTypes": [
|
|
691
|
+
"WatchMessageData"
|
|
692
|
+
],
|
|
693
|
+
"type": "WatchMessageData"
|
|
694
|
+
}
|
|
695
|
+
]
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"name": "MessageReceivedWithReplyEvent",
|
|
699
|
+
"slug": "messagereceivedwithreplyevent",
|
|
700
|
+
"docs": "Event data for messages that require a reply.",
|
|
701
|
+
"tags": [
|
|
702
|
+
{
|
|
703
|
+
"text": "8.0.0",
|
|
704
|
+
"name": "since"
|
|
705
|
+
}
|
|
706
|
+
],
|
|
707
|
+
"methods": [],
|
|
708
|
+
"properties": [
|
|
709
|
+
{
|
|
710
|
+
"name": "message",
|
|
711
|
+
"tags": [],
|
|
712
|
+
"docs": "The message data received from the watch.",
|
|
713
|
+
"complexTypes": [
|
|
714
|
+
"WatchMessageData"
|
|
715
|
+
],
|
|
716
|
+
"type": "WatchMessageData"
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
"name": "callbackId",
|
|
720
|
+
"tags": [],
|
|
721
|
+
"docs": "The callback ID to use when replying with replyToMessage().",
|
|
722
|
+
"complexTypes": [],
|
|
723
|
+
"type": "string"
|
|
724
|
+
}
|
|
725
|
+
]
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
"name": "ContextReceivedEvent",
|
|
729
|
+
"slug": "contextreceivedevent",
|
|
730
|
+
"docs": "Event data for application context updates.",
|
|
731
|
+
"tags": [
|
|
732
|
+
{
|
|
733
|
+
"text": "8.0.0",
|
|
734
|
+
"name": "since"
|
|
735
|
+
}
|
|
736
|
+
],
|
|
737
|
+
"methods": [],
|
|
738
|
+
"properties": [
|
|
739
|
+
{
|
|
740
|
+
"name": "context",
|
|
741
|
+
"tags": [],
|
|
742
|
+
"docs": "The context data received from the watch.",
|
|
743
|
+
"complexTypes": [
|
|
744
|
+
"WatchMessageData"
|
|
745
|
+
],
|
|
746
|
+
"type": "WatchMessageData"
|
|
747
|
+
}
|
|
748
|
+
]
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
"name": "UserInfoReceivedEvent",
|
|
752
|
+
"slug": "userinforeceivedevent",
|
|
753
|
+
"docs": "Event data for user info transfers.",
|
|
754
|
+
"tags": [
|
|
755
|
+
{
|
|
756
|
+
"text": "8.0.0",
|
|
757
|
+
"name": "since"
|
|
758
|
+
}
|
|
759
|
+
],
|
|
760
|
+
"methods": [],
|
|
761
|
+
"properties": [
|
|
762
|
+
{
|
|
763
|
+
"name": "userInfo",
|
|
764
|
+
"tags": [],
|
|
765
|
+
"docs": "The user info data received from the watch.",
|
|
766
|
+
"complexTypes": [
|
|
767
|
+
"WatchMessageData"
|
|
768
|
+
],
|
|
769
|
+
"type": "WatchMessageData"
|
|
770
|
+
}
|
|
771
|
+
]
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
"name": "ReachabilityChangedEvent",
|
|
775
|
+
"slug": "reachabilitychangedevent",
|
|
776
|
+
"docs": "Event data for reachability changes.",
|
|
777
|
+
"tags": [
|
|
778
|
+
{
|
|
779
|
+
"text": "8.0.0",
|
|
780
|
+
"name": "since"
|
|
781
|
+
}
|
|
782
|
+
],
|
|
783
|
+
"methods": [],
|
|
784
|
+
"properties": [
|
|
785
|
+
{
|
|
786
|
+
"name": "isReachable",
|
|
787
|
+
"tags": [],
|
|
788
|
+
"docs": "Whether the watch is now reachable.",
|
|
789
|
+
"complexTypes": [],
|
|
790
|
+
"type": "boolean"
|
|
791
|
+
}
|
|
792
|
+
]
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
"name": "ActivationStateChangedEvent",
|
|
796
|
+
"slug": "activationstatechangedevent",
|
|
797
|
+
"docs": "Event data for activation state changes.",
|
|
798
|
+
"tags": [
|
|
799
|
+
{
|
|
800
|
+
"text": "8.0.0",
|
|
801
|
+
"name": "since"
|
|
802
|
+
}
|
|
803
|
+
],
|
|
804
|
+
"methods": [],
|
|
805
|
+
"properties": [
|
|
806
|
+
{
|
|
807
|
+
"name": "state",
|
|
808
|
+
"tags": [],
|
|
809
|
+
"docs": "The new activation state.\n0 = notActivated, 1 = inactive, 2 = activated",
|
|
810
|
+
"complexTypes": [],
|
|
811
|
+
"type": "number"
|
|
812
|
+
}
|
|
813
|
+
]
|
|
814
|
+
}
|
|
815
|
+
],
|
|
816
|
+
"enums": [],
|
|
817
|
+
"typeAliases": [
|
|
818
|
+
{
|
|
819
|
+
"name": "WatchMessageData",
|
|
820
|
+
"slug": "watchmessagedata",
|
|
821
|
+
"docs": "Data that can be sent between iPhone and Apple Watch.\nValues must be serializable (string, number, boolean, arrays, or nested objects).",
|
|
822
|
+
"types": [
|
|
823
|
+
{
|
|
824
|
+
"text": "Record<string, unknown>",
|
|
825
|
+
"complexTypes": [
|
|
826
|
+
"Record"
|
|
827
|
+
]
|
|
828
|
+
}
|
|
829
|
+
]
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
"name": "Record",
|
|
833
|
+
"slug": "record",
|
|
834
|
+
"docs": "Construct a type with a set of properties K of type T",
|
|
835
|
+
"types": [
|
|
836
|
+
{
|
|
837
|
+
"text": "{\r\n [P in K]: T;\r\n}",
|
|
838
|
+
"complexTypes": [
|
|
839
|
+
"K",
|
|
840
|
+
"T"
|
|
841
|
+
]
|
|
842
|
+
}
|
|
843
|
+
]
|
|
844
|
+
}
|
|
845
|
+
],
|
|
846
|
+
"pluginConfigs": []
|
|
847
|
+
}
|