@capawesome/capacitor-singular 0.0.1

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.
Files changed (79) hide show
  1. package/CapawesomeCapacitorSingular.podspec +19 -0
  2. package/LICENSE +21 -0
  3. package/Package.swift +26 -0
  4. package/README.md +1262 -0
  5. package/android/build.gradle +61 -0
  6. package/android/src/main/AndroidManifest.xml +5 -0
  7. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/Singular.java +443 -0
  8. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/SingularHelper.java +53 -0
  9. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/SingularPlugin.java +336 -0
  10. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/CustomException.java +20 -0
  11. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/CustomExceptions.java +34 -0
  12. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/events/DeviceAttributionInfoReceivedEvent.java +48 -0
  13. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/events/SdidReceivedEvent.java +23 -0
  14. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/events/SdidSetEvent.java +23 -0
  15. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/events/SingularLinkResolvedEvent.java +44 -0
  16. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/CreateReferrerShortLinkOptions.java +61 -0
  17. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/InitializeOptions.java +168 -0
  18. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/SetCustomUserIdOptions.java +24 -0
  19. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/SetDeviceTokenOptions.java +24 -0
  20. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/SetGlobalPropertyOptions.java +44 -0
  21. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/SetLimitAdvertisingIdentifiersOptions.java +22 -0
  22. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/SetLimitDataSharingOptions.java +22 -0
  23. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/TrackAdRevenueOptions.java +157 -0
  24. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/TrackEventOptions.java +35 -0
  25. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/TrackRevenueOptions.java +56 -0
  26. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/UnsetGlobalPropertyOptions.java +24 -0
  27. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/results/CreateReferrerShortLinkResult.java +23 -0
  28. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/results/GetGlobalPropertiesResult.java +31 -0
  29. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/results/GetLimitDataSharingResult.java +22 -0
  30. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/results/IsAllTrackingStoppedResult.java +22 -0
  31. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/interfaces/Callback.java +5 -0
  32. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/interfaces/EmptyCallback.java +5 -0
  33. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/interfaces/NonEmptyResultCallback.java +7 -0
  34. package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/interfaces/Result.java +7 -0
  35. package/android/src/main/res/.gitkeep +0 -0
  36. package/dist/docs.json +2014 -0
  37. package/dist/esm/definitions.d.ts +925 -0
  38. package/dist/esm/definitions.js +39 -0
  39. package/dist/esm/definitions.js.map +1 -0
  40. package/dist/esm/index.d.ts +4 -0
  41. package/dist/esm/index.js +7 -0
  42. package/dist/esm/index.js.map +1 -0
  43. package/dist/esm/web.d.ts +27 -0
  44. package/dist/esm/web.js +73 -0
  45. package/dist/esm/web.js.map +1 -0
  46. package/dist/plugin.cjs.js +126 -0
  47. package/dist/plugin.cjs.js.map +1 -0
  48. package/dist/plugin.js +129 -0
  49. package/dist/plugin.js.map +1 -0
  50. package/ios/Plugin/Classes/Events/DeviceAttributionInfoReceivedEvent.swift +43 -0
  51. package/ios/Plugin/Classes/Events/SdidReceivedEvent.swift +16 -0
  52. package/ios/Plugin/Classes/Events/SdidSetEvent.swift +16 -0
  53. package/ios/Plugin/Classes/Events/SingularLinkResolvedEvent.swift +28 -0
  54. package/ios/Plugin/Classes/Events/SkanConversionValueUpdatedEvent.swift +30 -0
  55. package/ios/Plugin/Classes/Options/CreateReferrerShortLinkOptions.swift +25 -0
  56. package/ios/Plugin/Classes/Options/InitializeOptions.swift +44 -0
  57. package/ios/Plugin/Classes/Options/SetCustomUserIdOptions.swift +13 -0
  58. package/ios/Plugin/Classes/Options/SetDeviceTokenOptions.swift +30 -0
  59. package/ios/Plugin/Classes/Options/SetGlobalPropertyOptions.swift +20 -0
  60. package/ios/Plugin/Classes/Options/SetLimitAdvertisingIdentifiersOptions.swift +13 -0
  61. package/ios/Plugin/Classes/Options/SetLimitDataSharingOptions.swift +13 -0
  62. package/ios/Plugin/Classes/Options/SkanUpdateConversionValueOptions.swift +27 -0
  63. package/ios/Plugin/Classes/Options/TrackAdRevenueOptions.swift +47 -0
  64. package/ios/Plugin/Classes/Options/TrackEventOptions.swift +15 -0
  65. package/ios/Plugin/Classes/Options/TrackRevenueOptions.swift +22 -0
  66. package/ios/Plugin/Classes/Options/UnsetGlobalPropertyOptions.swift +13 -0
  67. package/ios/Plugin/Classes/Results/CreateReferrerShortLinkResult.swift +16 -0
  68. package/ios/Plugin/Classes/Results/GetGlobalPropertiesResult.swift +16 -0
  69. package/ios/Plugin/Classes/Results/GetLimitDataSharingResult.swift +16 -0
  70. package/ios/Plugin/Classes/Results/IsAllTrackingStoppedResult.swift +16 -0
  71. package/ios/Plugin/Classes/Results/SkanGetConversionValueResult.swift +20 -0
  72. package/ios/Plugin/Enums/CustomError.swift +88 -0
  73. package/ios/Plugin/Enums/SkanCoarseConversionValue.swift +31 -0
  74. package/ios/Plugin/Info.plist +24 -0
  75. package/ios/Plugin/Protocols/Result.swift +6 -0
  76. package/ios/Plugin/Singular.swift +341 -0
  77. package/ios/Plugin/SingularHelper.swift +40 -0
  78. package/ios/Plugin/SingularPlugin.swift +340 -0
  79. package/package.json +102 -0
@@ -0,0 +1,925 @@
1
+ import type { PluginListenerHandle } from '@capacitor/core';
2
+ export interface SingularPlugin {
3
+ /**
4
+ * Remove all global properties.
5
+ *
6
+ * Only available on Android and iOS.
7
+ *
8
+ * @since 0.1.0
9
+ */
10
+ clearGlobalProperties(): Promise<void>;
11
+ /**
12
+ * Create a short link that attributes installs to a referring user.
13
+ *
14
+ * The short link expires after 30 days.
15
+ *
16
+ * Only available on Android and iOS.
17
+ *
18
+ * @since 0.1.0
19
+ */
20
+ createReferrerShortLink(options: CreateReferrerShortLinkOptions): Promise<CreateReferrerShortLinkResult>;
21
+ /**
22
+ * Get all global properties.
23
+ *
24
+ * Only available on Android and iOS.
25
+ *
26
+ * @since 0.1.0
27
+ */
28
+ getGlobalProperties(): Promise<GetGlobalPropertiesResult>;
29
+ /**
30
+ * Get whether data sharing is limited.
31
+ *
32
+ * Only available on Android and iOS.
33
+ *
34
+ * @since 0.1.0
35
+ */
36
+ getLimitDataSharing(): Promise<GetLimitDataSharingResult>;
37
+ /**
38
+ * Initialize the Singular SDK and start the first session.
39
+ *
40
+ * This method must be called before any other method.
41
+ * Add your listeners before calling this method so that no
42
+ * deferred deep link or attribution event is missed.
43
+ *
44
+ * Only available on Android and iOS.
45
+ *
46
+ * @since 0.1.0
47
+ */
48
+ initialize(options: InitializeOptions): Promise<void>;
49
+ /**
50
+ * Get whether all tracking has been stopped via `stopAllTracking()`.
51
+ *
52
+ * Only available on Android and iOS.
53
+ *
54
+ * @since 0.1.0
55
+ */
56
+ isAllTrackingStopped(): Promise<IsAllTrackingStoppedResult>;
57
+ /**
58
+ * Resume all tracking after it was stopped via `stopAllTracking()`.
59
+ *
60
+ * Only available on Android and iOS.
61
+ *
62
+ * @since 0.1.0
63
+ */
64
+ resumeAllTracking(): Promise<void>;
65
+ /**
66
+ * Set the custom user ID that is attached to all sessions and events.
67
+ *
68
+ * Only available on Android and iOS.
69
+ *
70
+ * @since 0.1.0
71
+ */
72
+ setCustomUserId(options: SetCustomUserIdOptions): Promise<void>;
73
+ /**
74
+ * Set the push notification device token used for uninstall tracking.
75
+ *
76
+ * Only available on Android and iOS.
77
+ *
78
+ * @since 0.1.0
79
+ */
80
+ setDeviceToken(options: SetDeviceTokenOptions): Promise<void>;
81
+ /**
82
+ * Set a global property that is attached to all events.
83
+ *
84
+ * At most 5 global properties can be set.
85
+ * The call is rejected if the property could not be set.
86
+ *
87
+ * Only available on Android and iOS.
88
+ *
89
+ * @since 0.1.0
90
+ */
91
+ setGlobalProperty(options: SetGlobalPropertyOptions): Promise<void>;
92
+ /**
93
+ * Set whether the SDK is allowed to collect advertising identifiers
94
+ * (e.g. the Google Advertising ID or the IDFA).
95
+ *
96
+ * Only available on Android and iOS.
97
+ *
98
+ * @since 0.1.0
99
+ */
100
+ setLimitAdvertisingIdentifiers(options: SetLimitAdvertisingIdentifiersOptions): Promise<void>;
101
+ /**
102
+ * Set whether data sharing with third parties is limited
103
+ * (e.g. after the user opted out under CCPA).
104
+ *
105
+ * Only available on Android and iOS.
106
+ *
107
+ * @since 0.1.0
108
+ */
109
+ setLimitDataSharing(options: SetLimitDataSharingOptions): Promise<void>;
110
+ /**
111
+ * Get the current SKAdNetwork conversion value.
112
+ *
113
+ * Only available on iOS.
114
+ *
115
+ * @since 0.1.0
116
+ */
117
+ skanGetConversionValue(): Promise<SkanGetConversionValueResult>;
118
+ /**
119
+ * Register the app for SKAdNetwork attribution.
120
+ *
121
+ * Only required if `iosManualSkanConversionManagement` is enabled.
122
+ *
123
+ * Only available on iOS.
124
+ *
125
+ * @since 0.1.0
126
+ */
127
+ skanRegisterAppForAdNetworkAttribution(): Promise<void>;
128
+ /**
129
+ * Update the SKAdNetwork conversion value.
130
+ *
131
+ * Only required if `iosManualSkanConversionManagement` is enabled.
132
+ * The call is rejected if the conversion value could not be updated.
133
+ *
134
+ * Only available on iOS.
135
+ *
136
+ * @since 0.1.0
137
+ */
138
+ skanUpdateConversionValue(options: SkanUpdateConversionValueOptions): Promise<void>;
139
+ /**
140
+ * Stop all tracking.
141
+ *
142
+ * This setting persists across app restarts until `resumeAllTracking()` is called.
143
+ *
144
+ * Only available on Android and iOS.
145
+ *
146
+ * @since 0.1.0
147
+ */
148
+ stopAllTracking(): Promise<void>;
149
+ /**
150
+ * Track ad revenue.
151
+ *
152
+ * Only available on Android and iOS.
153
+ *
154
+ * @since 0.1.0
155
+ */
156
+ trackAdRevenue(options: TrackAdRevenueOptions): Promise<void>;
157
+ /**
158
+ * Track an event.
159
+ *
160
+ * Only available on Android and iOS.
161
+ *
162
+ * @since 0.1.0
163
+ */
164
+ trackEvent(options: TrackEventOptions): Promise<void>;
165
+ /**
166
+ * Track a revenue event.
167
+ *
168
+ * Only available on Android and iOS.
169
+ *
170
+ * @since 0.1.0
171
+ */
172
+ trackRevenue(options: TrackRevenueOptions): Promise<void>;
173
+ /**
174
+ * Notify the SDK that the user has opted in to tracking (e.g. under GDPR).
175
+ *
176
+ * Only available on Android and iOS.
177
+ *
178
+ * @since 0.1.0
179
+ */
180
+ trackingOptIn(): Promise<void>;
181
+ /**
182
+ * Notify the SDK that the user is under 13 years old
183
+ * so that the SDK does not collect advertising identifiers.
184
+ *
185
+ * Only available on Android and iOS.
186
+ *
187
+ * @since 0.1.0
188
+ */
189
+ trackingUnder13(): Promise<void>;
190
+ /**
191
+ * Remove the custom user ID.
192
+ *
193
+ * Only available on Android and iOS.
194
+ *
195
+ * @since 0.1.0
196
+ */
197
+ unsetCustomUserId(): Promise<void>;
198
+ /**
199
+ * Remove a global property.
200
+ *
201
+ * Only available on Android and iOS.
202
+ *
203
+ * @since 0.1.0
204
+ */
205
+ unsetGlobalProperty(options: UnsetGlobalPropertyOptions): Promise<void>;
206
+ /**
207
+ * Add a listener for when the device attribution information is received.
208
+ *
209
+ * The event is emitted once after the first session, and only if
210
+ * device attribution is enabled for your Singular account.
211
+ *
212
+ * Only available on Android and iOS.
213
+ *
214
+ * @since 0.1.0
215
+ */
216
+ addListener(eventName: 'deviceAttributionInfoReceived', listenerFunc: (event: DeviceAttributionInfoReceivedEvent) => void): Promise<PluginListenerHandle>;
217
+ /**
218
+ * Add a listener for when the Singular Device ID (SDID) is received.
219
+ *
220
+ * The event is emitted after the first session and on every
221
+ * subsequent launch with the stored SDID.
222
+ *
223
+ * Only available on Android and iOS.
224
+ *
225
+ * @since 0.1.0
226
+ */
227
+ addListener(eventName: 'sdidReceived', listenerFunc: (event: SdidReceivedEvent) => void): Promise<PluginListenerHandle>;
228
+ /**
229
+ * Add a listener for when a custom Singular Device ID (SDID) has been stored.
230
+ *
231
+ * Only available on Android and iOS.
232
+ *
233
+ * @since 0.1.0
234
+ */
235
+ addListener(eventName: 'sdidSet', listenerFunc: (event: SdidSetEvent) => void): Promise<PluginListenerHandle>;
236
+ /**
237
+ * Add a listener for when a Singular Link is resolved.
238
+ *
239
+ * This includes deferred deep links after an install.
240
+ *
241
+ * Only available on Android and iOS.
242
+ *
243
+ * @since 0.1.0
244
+ */
245
+ addListener(eventName: 'singularLinkResolved', listenerFunc: (event: SingularLinkResolvedEvent) => void): Promise<PluginListenerHandle>;
246
+ /**
247
+ * Add a listener for when the SDK updates the SKAdNetwork conversion value.
248
+ *
249
+ * Only available on iOS.
250
+ *
251
+ * @since 0.1.0
252
+ */
253
+ addListener(eventName: 'skanConversionValueUpdated', listenerFunc: (event: SkanConversionValueUpdatedEvent) => void): Promise<PluginListenerHandle>;
254
+ /**
255
+ * Remove all listeners for this plugin.
256
+ *
257
+ * @since 0.1.0
258
+ */
259
+ removeAllListeners(): Promise<void>;
260
+ }
261
+ /**
262
+ * @since 0.1.0
263
+ */
264
+ export interface CreateReferrerShortLinkOptions {
265
+ /**
266
+ * The Singular Link to shorten.
267
+ *
268
+ * @since 0.1.0
269
+ * @example 'https://myapp.sng.link/A1b2c/d3e4'
270
+ */
271
+ baseLink: string;
272
+ /**
273
+ * Additional parameters that are passed through to the installed app.
274
+ *
275
+ * @since 0.1.0
276
+ */
277
+ passthroughParameters?: Record<string, string>;
278
+ /**
279
+ * The unique identifier of the referring user.
280
+ *
281
+ * @since 0.1.0
282
+ */
283
+ referrerId: string;
284
+ /**
285
+ * The name of the referring user.
286
+ *
287
+ * @since 0.1.0
288
+ */
289
+ referrerName: string;
290
+ }
291
+ /**
292
+ * @since 0.1.0
293
+ */
294
+ export interface CreateReferrerShortLinkResult {
295
+ /**
296
+ * The generated short link.
297
+ *
298
+ * @since 0.1.0
299
+ */
300
+ link: string;
301
+ }
302
+ /**
303
+ * @since 0.1.0
304
+ */
305
+ export interface DeviceAttributionInfoReceivedEvent {
306
+ /**
307
+ * The identifier of the campaign.
308
+ *
309
+ * @since 0.1.0
310
+ */
311
+ campaignId?: string;
312
+ /**
313
+ * The name of the campaign.
314
+ *
315
+ * @since 0.1.0
316
+ */
317
+ campaignName?: string;
318
+ /**
319
+ * The timestamp of the attributed click in milliseconds since the Unix epoch.
320
+ *
321
+ * @since 0.1.0
322
+ */
323
+ clickTimestamp?: number;
324
+ /**
325
+ * The identifier of the creative.
326
+ *
327
+ * @since 0.1.0
328
+ */
329
+ creativeId?: string;
330
+ /**
331
+ * The name of the creative.
332
+ *
333
+ * @since 0.1.0
334
+ */
335
+ creativeName?: string;
336
+ /**
337
+ * The type of the attribution match.
338
+ *
339
+ * @since 0.1.0
340
+ */
341
+ matchType?: string;
342
+ /**
343
+ * The name of the attributed network.
344
+ *
345
+ * @since 0.1.0
346
+ * @example 'Organic'
347
+ */
348
+ network: string;
349
+ /**
350
+ * The passthrough parameters of the attributed link.
351
+ *
352
+ * @since 0.1.0
353
+ */
354
+ passthrough?: string;
355
+ /**
356
+ * The identifier of the sub campaign.
357
+ *
358
+ * @since 0.1.0
359
+ */
360
+ subcampaignId?: string;
361
+ /**
362
+ * The name of the sub campaign.
363
+ *
364
+ * @since 0.1.0
365
+ */
366
+ subcampaignName?: string;
367
+ }
368
+ /**
369
+ * @since 0.1.0
370
+ */
371
+ export interface GetGlobalPropertiesResult {
372
+ /**
373
+ * The global properties.
374
+ *
375
+ * @since 0.1.0
376
+ */
377
+ properties: Record<string, string>;
378
+ }
379
+ /**
380
+ * @since 0.1.0
381
+ */
382
+ export interface GetLimitDataSharingResult {
383
+ /**
384
+ * Whether data sharing is limited.
385
+ *
386
+ * @since 0.1.0
387
+ */
388
+ limit: boolean;
389
+ }
390
+ /**
391
+ * @since 0.1.0
392
+ */
393
+ export interface InitializeOptions {
394
+ /**
395
+ * The Facebook App ID used for Meta Install Referrer attribution.
396
+ *
397
+ * Only available on Android.
398
+ *
399
+ * @since 0.1.0
400
+ */
401
+ androidFacebookAppId?: string;
402
+ /**
403
+ * The SDK key of your Singular account.
404
+ *
405
+ * @since 0.1.0
406
+ */
407
+ apiKey: string;
408
+ /**
409
+ * The branded domains that should be resolved as Singular Links.
410
+ *
411
+ * @since 0.1.0
412
+ * @example ['links.myapp.com']
413
+ */
414
+ brandedDomains?: string[];
415
+ /**
416
+ * A custom Singular Device ID (SDID) that is used instead of the one
417
+ * generated by Singular.
418
+ *
419
+ * @since 0.1.0
420
+ */
421
+ customSdid?: string;
422
+ /**
423
+ * The custom user ID that is attached to all sessions and events.
424
+ *
425
+ * @since 0.1.0
426
+ */
427
+ customUserId?: string;
428
+ /**
429
+ * The email service provider domains that should be resolved as Singular Links.
430
+ *
431
+ * @since 0.1.0
432
+ * @example ['click.myapp.com']
433
+ */
434
+ espDomains?: string[];
435
+ /**
436
+ * Global properties that are attached to all events.
437
+ *
438
+ * Existing global properties with the same key are overridden.
439
+ * At most 5 global properties can be set.
440
+ *
441
+ * @since 0.1.0
442
+ */
443
+ globalProperties?: Record<string, string>;
444
+ /**
445
+ * Whether the SKAdNetwork conversion value is managed by your app
446
+ * instead of by the SDK.
447
+ *
448
+ * Only available on iOS.
449
+ *
450
+ * @since 0.1.0
451
+ * @default false
452
+ */
453
+ iosManualSkanConversionManagement?: boolean;
454
+ /**
455
+ * Whether SKAdNetwork support is enabled.
456
+ *
457
+ * Only available on iOS.
458
+ *
459
+ * @since 0.1.0
460
+ * @default true
461
+ */
462
+ iosSkAdNetworkEnabled?: boolean;
463
+ /**
464
+ * The number of seconds the SDK waits for the App Tracking Transparency
465
+ * authorization before sending the first session.
466
+ *
467
+ * Set this to a value greater than `0` if you request the tracking
468
+ * authorization right after the app launch.
469
+ *
470
+ * Only available on iOS.
471
+ *
472
+ * @since 0.1.0
473
+ * @default 0
474
+ */
475
+ iosWaitForTrackingAuthorizationTimeout?: number;
476
+ /**
477
+ * Whether the SDK is not allowed to collect advertising identifiers
478
+ * (e.g. the Google Advertising ID or the IDFA).
479
+ *
480
+ * @since 0.1.0
481
+ * @default false
482
+ */
483
+ limitAdvertisingIdentifiers?: boolean;
484
+ /**
485
+ * Whether data sharing with third parties is limited.
486
+ *
487
+ * @since 0.1.0
488
+ * @default false
489
+ */
490
+ limitDataSharing?: boolean;
491
+ /**
492
+ * Whether debug logging is enabled.
493
+ *
494
+ * @since 0.1.0
495
+ * @default false
496
+ */
497
+ loggingEnabled?: boolean;
498
+ /**
499
+ * The SDK secret of your Singular account.
500
+ *
501
+ * @since 0.1.0
502
+ */
503
+ secret: string;
504
+ /**
505
+ * The number of seconds the app can stay in the background
506
+ * before a new session is started.
507
+ *
508
+ * @since 0.1.0
509
+ * @default 60
510
+ */
511
+ sessionTimeout?: number;
512
+ /**
513
+ * The number of seconds the SDK waits for a short link to be resolved.
514
+ *
515
+ * @since 0.1.0
516
+ * @default 10
517
+ */
518
+ shortLinkResolveTimeout?: number;
519
+ }
520
+ /**
521
+ * @since 0.1.0
522
+ */
523
+ export interface IsAllTrackingStoppedResult {
524
+ /**
525
+ * Whether all tracking has been stopped.
526
+ *
527
+ * @since 0.1.0
528
+ */
529
+ stopped: boolean;
530
+ }
531
+ /**
532
+ * @since 0.1.0
533
+ */
534
+ export interface SdidReceivedEvent {
535
+ /**
536
+ * The Singular Device ID.
537
+ *
538
+ * @since 0.1.0
539
+ */
540
+ sdid: string;
541
+ }
542
+ /**
543
+ * @since 0.1.0
544
+ */
545
+ export interface SdidSetEvent {
546
+ /**
547
+ * The Singular Device ID.
548
+ *
549
+ * @since 0.1.0
550
+ */
551
+ sdid: string;
552
+ }
553
+ /**
554
+ * @since 0.1.0
555
+ */
556
+ export interface SetCustomUserIdOptions {
557
+ /**
558
+ * The custom user ID.
559
+ *
560
+ * @since 0.1.0
561
+ */
562
+ customUserId: string;
563
+ }
564
+ /**
565
+ * @since 0.1.0
566
+ */
567
+ export interface SetDeviceTokenOptions {
568
+ /**
569
+ * The push notification device token.
570
+ *
571
+ * On Android, this is the FCM registration token.
572
+ * On iOS, this is the hex-encoded APNs device token.
573
+ *
574
+ * @since 0.1.0
575
+ */
576
+ token: string;
577
+ }
578
+ /**
579
+ * @since 0.1.0
580
+ */
581
+ export interface SetGlobalPropertyOptions {
582
+ /**
583
+ * The key of the global property.
584
+ *
585
+ * @since 0.1.0
586
+ */
587
+ key: string;
588
+ /**
589
+ * Whether an existing global property with the same key is overridden.
590
+ *
591
+ * @since 0.1.0
592
+ * @default true
593
+ */
594
+ overrideExisting?: boolean;
595
+ /**
596
+ * The value of the global property.
597
+ *
598
+ * @since 0.1.0
599
+ */
600
+ value: string;
601
+ }
602
+ /**
603
+ * @since 0.1.0
604
+ */
605
+ export interface SetLimitAdvertisingIdentifiersOptions {
606
+ /**
607
+ * Whether the SDK is not allowed to collect advertising identifiers.
608
+ *
609
+ * @since 0.1.0
610
+ */
611
+ limit: boolean;
612
+ }
613
+ /**
614
+ * @since 0.1.0
615
+ */
616
+ export interface SetLimitDataSharingOptions {
617
+ /**
618
+ * Whether data sharing with third parties is limited.
619
+ *
620
+ * @since 0.1.0
621
+ */
622
+ limit: boolean;
623
+ }
624
+ /**
625
+ * @since 0.1.0
626
+ */
627
+ export interface SingularLinkResolvedEvent {
628
+ /**
629
+ * The deep link value of the Singular Link.
630
+ *
631
+ * @since 0.1.0
632
+ */
633
+ deepLink: string | null;
634
+ /**
635
+ * Whether the link is a deferred deep link (i.e. resolved after an install).
636
+ *
637
+ * @since 0.1.0
638
+ */
639
+ isDeferred: boolean;
640
+ /**
641
+ * The passthrough value of the Singular Link.
642
+ *
643
+ * @since 0.1.0
644
+ */
645
+ passthrough: string | null;
646
+ /**
647
+ * The query parameters of the Singular Link.
648
+ *
649
+ * @since 0.1.0
650
+ */
651
+ urlParameters: Record<string, string>;
652
+ }
653
+ /**
654
+ * @since 0.1.0
655
+ */
656
+ export interface SkanConversionValueUpdatedEvent {
657
+ /**
658
+ * The coarse conversion value.
659
+ *
660
+ * Only available on iOS 16.1+.
661
+ *
662
+ * @since 0.1.0
663
+ */
664
+ coarseValue: SkanCoarseConversionValue | null;
665
+ /**
666
+ * Whether the conversion window is locked.
667
+ *
668
+ * Only available on iOS 16.1+.
669
+ *
670
+ * @since 0.1.0
671
+ */
672
+ lockWindow: boolean;
673
+ /**
674
+ * The fine-grained conversion value (`0` - `63`).
675
+ *
676
+ * @since 0.1.0
677
+ */
678
+ value: number | null;
679
+ }
680
+ /**
681
+ * @since 0.1.0
682
+ */
683
+ export interface SkanGetConversionValueResult {
684
+ /**
685
+ * The fine-grained conversion value (`0` - `63`)
686
+ * or `null` if no value has been set yet.
687
+ *
688
+ * @since 0.1.0
689
+ */
690
+ value: number | null;
691
+ }
692
+ /**
693
+ * @since 0.1.0
694
+ */
695
+ export interface SkanUpdateConversionValueOptions {
696
+ /**
697
+ * The coarse conversion value.
698
+ *
699
+ * Only available on iOS 16.1+.
700
+ *
701
+ * @since 0.1.0
702
+ */
703
+ coarseValue?: SkanCoarseConversionValue;
704
+ /**
705
+ * Whether the conversion window should be locked.
706
+ *
707
+ * Only available on iOS 16.1+.
708
+ *
709
+ * @since 0.1.0
710
+ * @default false
711
+ */
712
+ lockWindow?: boolean;
713
+ /**
714
+ * The fine-grained conversion value (`0` - `63`).
715
+ *
716
+ * @since 0.1.0
717
+ */
718
+ value: number;
719
+ }
720
+ /**
721
+ * @since 0.1.0
722
+ */
723
+ export interface TrackAdRevenueOptions {
724
+ /**
725
+ * The identifier of the ad group.
726
+ *
727
+ * @since 0.1.0
728
+ */
729
+ adGroupId?: string;
730
+ /**
731
+ * The name of the ad group.
732
+ *
733
+ * @since 0.1.0
734
+ */
735
+ adGroupName?: string;
736
+ /**
737
+ * The priority of the ad group.
738
+ *
739
+ * @since 0.1.0
740
+ */
741
+ adGroupPriority?: string;
742
+ /**
743
+ * The type of the ad group.
744
+ *
745
+ * @since 0.1.0
746
+ */
747
+ adGroupType?: string;
748
+ /**
749
+ * The name of the ad placement.
750
+ *
751
+ * @since 0.1.0
752
+ */
753
+ adPlacementName?: string;
754
+ /**
755
+ * The ad mediation platform that reported the revenue.
756
+ *
757
+ * @since 0.1.0
758
+ * @example 'AdMob'
759
+ */
760
+ adPlatform: string;
761
+ /**
762
+ * The type of the ad.
763
+ *
764
+ * @since 0.1.0
765
+ * @example 'Rewarded'
766
+ */
767
+ adType?: string;
768
+ /**
769
+ * The identifier of the ad unit.
770
+ *
771
+ * @since 0.1.0
772
+ */
773
+ adUnitId?: string;
774
+ /**
775
+ * The name of the ad unit.
776
+ *
777
+ * @since 0.1.0
778
+ */
779
+ adUnitName?: string;
780
+ /**
781
+ * The currency of the revenue as ISO 4217 code.
782
+ *
783
+ * @since 0.1.0
784
+ * @example 'USD'
785
+ */
786
+ currency: string;
787
+ /**
788
+ * The identifier of the ad impression.
789
+ *
790
+ * @since 0.1.0
791
+ */
792
+ impressionId?: string;
793
+ /**
794
+ * The name of the ad network that served the ad.
795
+ *
796
+ * @since 0.1.0
797
+ */
798
+ networkName?: string;
799
+ /**
800
+ * The identifier of the placement.
801
+ *
802
+ * @since 0.1.0
803
+ */
804
+ placementId?: string;
805
+ /**
806
+ * The precision of the reported revenue.
807
+ *
808
+ * @since 0.1.0
809
+ * @example 'estimated'
810
+ */
811
+ precision?: string;
812
+ /**
813
+ * The revenue amount.
814
+ *
815
+ * @since 0.1.0
816
+ * @example 0.05
817
+ */
818
+ revenue: number;
819
+ }
820
+ /**
821
+ * @since 0.1.0
822
+ */
823
+ export interface TrackEventOptions {
824
+ /**
825
+ * The attributes of the event.
826
+ *
827
+ * Attribute keys and values are limited to 500 characters.
828
+ *
829
+ * @since 0.1.0
830
+ * @example { level: 3, character: 'warrior' }
831
+ */
832
+ attributes?: Record<string, string | number | boolean>;
833
+ /**
834
+ * The name of the event.
835
+ *
836
+ * Can be a standard event name (e.g. `sng_login`, `sng_tutorial_complete`)
837
+ * or a custom event name. Limited to 32 characters.
838
+ *
839
+ * @since 0.1.0
840
+ * @example 'sng_login'
841
+ */
842
+ name: string;
843
+ }
844
+ /**
845
+ * @since 0.1.0
846
+ */
847
+ export interface TrackRevenueOptions {
848
+ /**
849
+ * The revenue amount.
850
+ *
851
+ * @since 0.1.0
852
+ * @example 9.99
853
+ */
854
+ amount: number;
855
+ /**
856
+ * The attributes of the event.
857
+ *
858
+ * @since 0.1.0
859
+ */
860
+ attributes?: Record<string, string | number | boolean>;
861
+ /**
862
+ * The currency of the revenue as ISO 4217 code.
863
+ *
864
+ * @since 0.1.0
865
+ * @example 'USD'
866
+ */
867
+ currency: string;
868
+ /**
869
+ * The name of the event.
870
+ *
871
+ * If provided, a custom revenue event with this name is tracked
872
+ * instead of the default revenue event.
873
+ *
874
+ * @since 0.1.0
875
+ * @example 'subscription_purchase'
876
+ */
877
+ eventName?: string;
878
+ }
879
+ /**
880
+ * @since 0.1.0
881
+ */
882
+ export interface UnsetGlobalPropertyOptions {
883
+ /**
884
+ * The key of the global property.
885
+ *
886
+ * @since 0.1.0
887
+ */
888
+ key: string;
889
+ }
890
+ /**
891
+ * @since 0.1.0
892
+ */
893
+ export declare enum ErrorCode {
894
+ /**
895
+ * The initialization of the SDK failed.
896
+ *
897
+ * @since 0.1.0
898
+ */
899
+ InitializationFailed = "INITIALIZATION_FAILED",
900
+ /**
901
+ * The plugin has not been initialized yet.
902
+ *
903
+ * Call `initialize(...)` before calling any other method.
904
+ *
905
+ * @since 0.1.0
906
+ */
907
+ NotInitialized = "NOT_INITIALIZED"
908
+ }
909
+ /**
910
+ * @since 0.1.0
911
+ */
912
+ export declare enum SkanCoarseConversionValue {
913
+ /**
914
+ * @since 0.1.0
915
+ */
916
+ High = "HIGH",
917
+ /**
918
+ * @since 0.1.0
919
+ */
920
+ Low = "LOW",
921
+ /**
922
+ * @since 0.1.0
923
+ */
924
+ Medium = "MEDIUM"
925
+ }