@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
package/README.md ADDED
@@ -0,0 +1,1262 @@
1
+ # Capacitor Singular Plugin
2
+
3
+ Unofficial Capacitor plugin for the [Singular Mobile SDK](https://support.singular.net/hc/en-us/articles/360037640172-Integrating-a-Singular-SDK-Planning-and-Prerequisites).[^1]
4
+
5
+ <div class="capawesome-z29o10a">
6
+ <a href="https://cloud.capawesome.io/" target="_blank">
7
+ <img alt="Deliver Live Updates to your Capacitor app with Capawesome Cloud" src="https://cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png?t=1" />
8
+ </a>
9
+ </div>
10
+
11
+ ## Features
12
+
13
+ The Capacitor Singular plugin is a modern integration of the Singular Mobile SDK for Capacitor apps. Here are some of the key features:
14
+
15
+ - 🖥️ **Cross-platform**: Supports Android and iOS.
16
+ - 📈 **Attribution**: Attribute app installs and re-engagements to your ad campaigns.
17
+ - 🎯 **Events & Revenue**: Track standard and custom events as well as in-app revenue.
18
+ - 💰 **Ad Revenue**: Report ad revenue from your mediation platform to measure ROAS.
19
+ - 🔗 **Singular Links**: Handle deep links and deferred deep links after an install.
20
+ - 🍎 **SKAdNetwork**: Let the SDK manage the conversion value or update it yourself.
21
+ - 🔒 **Privacy**: Comply with GDPR and CCPA using the built-in consent and opt-out controls.
22
+ - 🗑️ **Uninstall Tracking**: Measure uninstalls using push notification device tokens.
23
+ - 📦 **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.
24
+ - 🔁 **Up-to-date**: Always supports the latest Capacitor version.
25
+
26
+ Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!
27
+
28
+ ## Use Cases
29
+
30
+ Singular is a Mobile Measurement Partner (MMP). The plugin is typically used to measure and optimize paid user acquisition, for example:
31
+
32
+ - **Install attribution**: Attribute app installs to the network, campaign and creative that drove them.
33
+ - **Campaign optimization**: Report in-app events, purchase revenue and ad revenue to measure ROI and ROAS.
34
+ - **Deep linking**: Route users to the right screen with Singular Links, including deferred deep links after an install.
35
+ - **Referral programs**: Generate short links that attribute installs to a referring user.
36
+ - **Privacy compliance**: Collect consent and honor opt-outs under GDPR and CCPA.
37
+
38
+ ## Compatibility
39
+
40
+ | Plugin Version | Capacitor Version | Status |
41
+ | -------------- | ----------------- | -------------- |
42
+ | 0.x.x | >=8.x.x | Active support |
43
+
44
+ ## Installation
45
+
46
+ You can use our **AI-Assisted Setup** to install the plugin.
47
+ Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:
48
+
49
+ ```bash
50
+ npx skills add capawesome-team/skills --skill capacitor-plugins
51
+ ```
52
+
53
+ Then use the following prompt:
54
+
55
+ ```
56
+ Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-singular` plugin in my project.
57
+ ```
58
+
59
+ If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:
60
+
61
+ ```bash
62
+ npm install @capawesome/capacitor-singular
63
+ npx cap sync
64
+ ```
65
+
66
+ This plugin requires a [Singular](https://www.singular.net/) account. You can find the **SDK Key** and the **SDK Secret** of your app in the Singular dashboard under **Developer Tools → SDK Integration → SDK Keys**. Do not use the Singular Reporting API key, otherwise no SDK data is received.
67
+
68
+ > [!IMPORTANT]
69
+ > Use of the Singular SDKs is governed by the [Singular Terms & Conditions of Service](https://www.singular.net/terms/), which limit the use of the service to your own advertising and promotions and prohibit sending Protected Health Information (as defined under HIPAA) to Singular (see [Third-Party Notices](#third-party-notices)). This plugin declares the SDKs as dependencies and downloads them from Singular's Maven repository, CocoaPods or Swift Package Manager at build time. It does not bundle or modify them.
70
+
71
+ ### Android
72
+
73
+ The [Singular SDK for Android](https://support.singular.net/hc/en-us/articles/360037581952-Android-SDK-Basic-Integration) is not published on Maven Central. Add Singular's Maven repository to the `allprojects` section of your `android/build.gradle` file:
74
+
75
+ ```groovy
76
+ allprojects {
77
+ repositories {
78
+ google()
79
+ mavenCentral()
80
+ maven { url 'https://maven.singular.net/' }
81
+ }
82
+ }
83
+ ```
84
+
85
+ If your project declares its repositories in the `android/settings.gradle` file instead (via `dependencyResolutionManagement`), add the repository there.
86
+
87
+ #### Permissions
88
+
89
+ This plugin already declares the `INTERNET`, `ACCESS_NETWORK_STATE` and `com.google.android.gms.permission.AD_ID` permissions in its `AndroidManifest.xml` file, so no manual configuration is required.
90
+
91
+ Apps that participate in the [Google Play Families program](https://support.google.com/googleplay/android-developer/answer/9893335) must not request the advertising ID. Add the following element to your `AndroidManifest.xml` file before or after the `application` tag to remove the permission:
92
+
93
+ ```xml
94
+ <!-- Required for apps in the Google Play Families program. -->
95
+ <uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" />
96
+ ```
97
+
98
+ Make sure that the `tools` namespace is declared on the `manifest` element (`xmlns:tools="http://schemas.android.com/tools"`).
99
+
100
+ #### Proguard
101
+
102
+ If you are using Proguard, you need to add the following rules to your `proguard-rules.pro` file:
103
+
104
+ ```
105
+ -keep class com.singular.sdk.** { *; }
106
+ -keep public class com.android.installreferrer.** { *; }
107
+ ```
108
+
109
+ #### Variables
110
+
111
+ This plugin will use the following project variables (defined in your app's `variables.gradle` file):
112
+
113
+ - `$singularSdkVersion` version of `com.singular.sdk:singular_sdk` (default: `12.16.0`)
114
+
115
+ #### Singular Links
116
+
117
+ To open [Singular Links](https://support.singular.net/hc/en-us/articles/35356520601755-Android-SDK-Supporting-Deep-Links) in your app, add an App Links intent filter to the `MainActivity` in your `AndroidManifest.xml` file:
118
+
119
+ ```xml
120
+ <intent-filter android:autoVerify="true">
121
+ <action android:name="android.intent.action.VIEW" />
122
+ <category android:name="android.intent.category.DEFAULT" />
123
+ <category android:name="android.intent.category.BROWSABLE" />
124
+ <data android:scheme="https" android:host="YOUR_SUBDOMAIN.sng.link" android:pathPrefix="/A" />
125
+ <data android:scheme="https" android:host="YOUR_SUBDOMAIN.sng.link" android:pathPrefix="/B" />
126
+ <data android:scheme="https" android:host="YOUR_SUBDOMAIN.sng.link" android:pathPrefix="/E" />
127
+ <data android:scheme="https" android:host="YOUR_SUBDOMAIN.sng.link" android:pathPrefix="/F" />
128
+ </intent-filter>
129
+ ```
130
+
131
+ Replace `YOUR_SUBDOMAIN` with the subdomain of your Singular Links domain. Singular hosts the required `assetlinks.json` file for you, but you must enter the SHA256 fingerprints of your signing keys in the Singular dashboard under **Settings → Apps** so that Android can verify the App Links.
132
+
133
+ ### iOS
134
+
135
+ The [Singular SDK for iOS](https://github.com/singular-labs/Singular-iOS-SDK) can be integrated via Swift Package Manager (recommended) or CocoaPods. This plugin requires iOS 15 or later.
136
+
137
+ #### App Tracking Transparency
138
+
139
+ The SDK only collects the advertising identifier (IDFA) if the user has granted tracking permission. You can request the permission with the [App Tracking Transparency](https://capawesome.io/docs/sdks/capacitor/app-tracking-transparency/) plugin. In that case, add the `NSUserTrackingUsageDescription` key to your `ios/App/App/Info.plist` file:
140
+
141
+ ```xml
142
+ <key>NSUserTrackingUsageDescription</key>
143
+ <string>The advertising identifier is used to measure the performance of our advertising campaigns.</string>
144
+ ```
145
+
146
+ Set `iosWaitForTrackingAuthorizationTimeout` when calling `initialize(...)` so that the SDK waits for the user's decision before it sends the first session.
147
+
148
+ #### Singular Links
149
+
150
+ To open Singular Links in your app, add the **Associated Domains** capability to your app in Xcode and add an entry for each Singular Links domain in the format `applinks:YOUR_SUBDOMAIN.sng.link`.
151
+
152
+ #### SKAdNetwork
153
+
154
+ [SKAdNetwork](https://support.singular.net/hc/en-us/articles/360047448611-Introduction-to-Singular-s-SKAdNetwork-Solution) support is enabled by default and the SDK manages the conversion value for you. Set `iosManualSkanConversionManagement` to `true` when calling `initialize(...)` if your app manages the conversion value itself. In that case, call `skanRegisterAppForAdNetworkAttribution()` and `skanUpdateConversionValue(...)` yourself.
155
+
156
+ ## Configuration
157
+
158
+ No configuration required for this plugin.
159
+
160
+ ## Usage
161
+
162
+ The following examples show how to use the plugin.
163
+
164
+ ### Initialize the plugin
165
+
166
+ Add your listeners before calling `initialize(...)` so that no deferred deep link or attribution event is missed:
167
+
168
+ ```typescript
169
+ import { Singular } from '@capawesome/capacitor-singular';
170
+
171
+ const initialize = async () => {
172
+ await Singular.addListener('singularLinkResolved', event => {
173
+ console.log('Singular Link resolved', event.deepLink, event.isDeferred);
174
+ });
175
+ await Singular.addListener('deviceAttributionInfoReceived', event => {
176
+ console.log('Attributed to network', event.network);
177
+ });
178
+
179
+ await Singular.initialize({
180
+ apiKey: 'YOUR_SDK_KEY',
181
+ secret: 'YOUR_SDK_SECRET',
182
+ });
183
+ };
184
+ ```
185
+
186
+ ### Track events
187
+
188
+ Track a standard event or a custom event with attributes:
189
+
190
+ ```typescript
191
+ import { Singular } from '@capawesome/capacitor-singular';
192
+
193
+ const trackLogin = async () => {
194
+ await Singular.trackEvent({
195
+ name: 'sng_login',
196
+ });
197
+ };
198
+
199
+ const trackLevelCompleted = async () => {
200
+ await Singular.trackEvent({
201
+ name: 'level_completed',
202
+ attributes: { level: 3, character: 'warrior' },
203
+ });
204
+ };
205
+ ```
206
+
207
+ See [Singular Standard Events](https://support.singular.net/hc/en-us/articles/7648172966299-Singular-Standard-Events-Full-List-and-Recommended-Events-by-Vertical) for the list of standard event names and attributes.
208
+
209
+ ### Track revenue
210
+
211
+ ```typescript
212
+ import { Singular } from '@capawesome/capacitor-singular';
213
+
214
+ const trackRevenue = async () => {
215
+ await Singular.trackRevenue({
216
+ amount: 9.99,
217
+ currency: 'USD',
218
+ eventName: 'subscription_purchase',
219
+ });
220
+ };
221
+ ```
222
+
223
+ ### Track ad revenue
224
+
225
+ ```typescript
226
+ import { Singular } from '@capawesome/capacitor-singular';
227
+
228
+ const trackAdRevenue = async () => {
229
+ await Singular.trackAdRevenue({
230
+ adPlatform: 'AdMob',
231
+ adType: 'Rewarded',
232
+ currency: 'USD',
233
+ revenue: 0.05,
234
+ });
235
+ };
236
+ ```
237
+
238
+ ### Set the custom user ID
239
+
240
+ ```typescript
241
+ import { Singular } from '@capawesome/capacitor-singular';
242
+
243
+ const login = async () => {
244
+ await Singular.setCustomUserId({ customUserId: 'user-123' });
245
+ };
246
+
247
+ const logout = async () => {
248
+ await Singular.unsetCustomUserId();
249
+ };
250
+ ```
251
+
252
+ ### Global properties
253
+
254
+ Global properties are attached to all events. At most 5 global properties can be set:
255
+
256
+ ```typescript
257
+ import { Singular } from '@capawesome/capacitor-singular';
258
+
259
+ const setGlobalProperty = async () => {
260
+ await Singular.setGlobalProperty({ key: 'plan', value: 'premium' });
261
+ };
262
+
263
+ const getGlobalProperties = async () => {
264
+ const { properties } = await Singular.getGlobalProperties();
265
+ return properties;
266
+ };
267
+
268
+ const clearGlobalProperties = async () => {
269
+ await Singular.clearGlobalProperties();
270
+ };
271
+ ```
272
+
273
+ ### Privacy
274
+
275
+ Notify the SDK about the consent of the user and stop tracking if the user opts out:
276
+
277
+ ```typescript
278
+ import { Singular } from '@capawesome/capacitor-singular';
279
+
280
+ const optIn = async () => {
281
+ await Singular.trackingOptIn();
282
+ };
283
+
284
+ const optOut = async () => {
285
+ await Singular.stopAllTracking();
286
+ };
287
+
288
+ const limitDataSharing = async () => {
289
+ await Singular.setLimitDataSharing({ limit: true });
290
+ };
291
+ ```
292
+
293
+ Call `resumeAllTracking()` to resume tracking and `trackingUnder13()` if the user is under 13 years old.
294
+
295
+ ### Singular Links
296
+
297
+ Handle deep links and deferred deep links and create a short link for a referring user:
298
+
299
+ ```typescript
300
+ import { Singular } from '@capawesome/capacitor-singular';
301
+
302
+ const addSingularLinkResolvedListener = async () => {
303
+ await Singular.addListener('singularLinkResolved', event => {
304
+ console.log('Deep link', event.deepLink);
305
+ console.log('Deferred', event.isDeferred);
306
+ console.log('URL parameters', event.urlParameters);
307
+ });
308
+ };
309
+
310
+ const createReferrerShortLink = async () => {
311
+ const { link } = await Singular.createReferrerShortLink({
312
+ baseLink: 'https://myapp.sng.link/A1b2c/d3e4',
313
+ passthroughParameters: { campaign: 'friend-invite' },
314
+ referrerId: 'user-123',
315
+ referrerName: 'Jane Doe',
316
+ });
317
+ return link;
318
+ };
319
+ ```
320
+
321
+ ### SKAdNetwork
322
+
323
+ Only required if `iosManualSkanConversionManagement` is enabled:
324
+
325
+ ```typescript
326
+ import {
327
+ Singular,
328
+ SkanCoarseConversionValue,
329
+ } from '@capawesome/capacitor-singular';
330
+
331
+ const registerAppForAdNetworkAttribution = async () => {
332
+ await Singular.skanRegisterAppForAdNetworkAttribution();
333
+ };
334
+
335
+ const updateConversionValue = async () => {
336
+ await Singular.skanUpdateConversionValue({
337
+ coarseValue: SkanCoarseConversionValue.Medium,
338
+ value: 10,
339
+ });
340
+ };
341
+
342
+ const getConversionValue = async () => {
343
+ const { value } = await Singular.skanGetConversionValue();
344
+ return value;
345
+ };
346
+ ```
347
+
348
+ ### Uninstall tracking
349
+
350
+ Pass the push notification device token to the SDK. On Android, this is the FCM registration token. On iOS, this is the hex-encoded APNs device token:
351
+
352
+ ```typescript
353
+ import { PushNotifications } from '@capacitor/push-notifications';
354
+ import { Singular } from '@capawesome/capacitor-singular';
355
+
356
+ const enableUninstallTracking = async () => {
357
+ await PushNotifications.addListener('registration', async token => {
358
+ await Singular.setDeviceToken({ token: token.value });
359
+ });
360
+ await PushNotifications.register();
361
+ };
362
+ ```
363
+
364
+ ### Singular Device ID
365
+
366
+ The Singular Device ID (SDID) is resolved by Singular during the first session. Add the listener before calling `initialize(...)`:
367
+
368
+ ```typescript
369
+ import { Singular } from '@capawesome/capacitor-singular';
370
+
371
+ const addSdidReceivedListener = async () => {
372
+ await Singular.addListener('sdidReceived', event => {
373
+ console.log('SDID', event.sdid);
374
+ });
375
+ };
376
+ ```
377
+
378
+ Set `customSdid` when calling `initialize(...)` to use your own identifier instead. The `sdidSet` event is emitted once it has been stored.
379
+
380
+ ## API
381
+
382
+ <docgen-index>
383
+
384
+ * [`clearGlobalProperties()`](#clearglobalproperties)
385
+ * [`createReferrerShortLink(...)`](#createreferrershortlink)
386
+ * [`getGlobalProperties()`](#getglobalproperties)
387
+ * [`getLimitDataSharing()`](#getlimitdatasharing)
388
+ * [`initialize(...)`](#initialize)
389
+ * [`isAllTrackingStopped()`](#isalltrackingstopped)
390
+ * [`resumeAllTracking()`](#resumealltracking)
391
+ * [`setCustomUserId(...)`](#setcustomuserid)
392
+ * [`setDeviceToken(...)`](#setdevicetoken)
393
+ * [`setGlobalProperty(...)`](#setglobalproperty)
394
+ * [`setLimitAdvertisingIdentifiers(...)`](#setlimitadvertisingidentifiers)
395
+ * [`setLimitDataSharing(...)`](#setlimitdatasharing)
396
+ * [`skanGetConversionValue()`](#skangetconversionvalue)
397
+ * [`skanRegisterAppForAdNetworkAttribution()`](#skanregisterappforadnetworkattribution)
398
+ * [`skanUpdateConversionValue(...)`](#skanupdateconversionvalue)
399
+ * [`stopAllTracking()`](#stopalltracking)
400
+ * [`trackAdRevenue(...)`](#trackadrevenue)
401
+ * [`trackEvent(...)`](#trackevent)
402
+ * [`trackRevenue(...)`](#trackrevenue)
403
+ * [`trackingOptIn()`](#trackingoptin)
404
+ * [`trackingUnder13()`](#trackingunder13)
405
+ * [`unsetCustomUserId()`](#unsetcustomuserid)
406
+ * [`unsetGlobalProperty(...)`](#unsetglobalproperty)
407
+ * [`addListener('deviceAttributionInfoReceived', ...)`](#addlistenerdeviceattributioninforeceived-)
408
+ * [`addListener('sdidReceived', ...)`](#addlistenersdidreceived-)
409
+ * [`addListener('sdidSet', ...)`](#addlistenersdidset-)
410
+ * [`addListener('singularLinkResolved', ...)`](#addlistenersingularlinkresolved-)
411
+ * [`addListener('skanConversionValueUpdated', ...)`](#addlistenerskanconversionvalueupdated-)
412
+ * [`removeAllListeners()`](#removealllisteners)
413
+ * [Interfaces](#interfaces)
414
+ * [Enums](#enums)
415
+
416
+ </docgen-index>
417
+
418
+ <docgen-api>
419
+ <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
420
+
421
+ ### clearGlobalProperties()
422
+
423
+ ```typescript
424
+ clearGlobalProperties() => Promise<void>
425
+ ```
426
+
427
+ Remove all global properties.
428
+
429
+ Only available on Android and iOS.
430
+
431
+ **Since:** 0.1.0
432
+
433
+ --------------------
434
+
435
+
436
+ ### createReferrerShortLink(...)
437
+
438
+ ```typescript
439
+ createReferrerShortLink(options: CreateReferrerShortLinkOptions) => Promise<CreateReferrerShortLinkResult>
440
+ ```
441
+
442
+ Create a short link that attributes installs to a referring user.
443
+
444
+ The short link expires after 30 days.
445
+
446
+ Only available on Android and iOS.
447
+
448
+ | Param | Type |
449
+ | ------------- | ----------------------------------------------------------------------------------------- |
450
+ | **`options`** | <code><a href="#createreferrershortlinkoptions">CreateReferrerShortLinkOptions</a></code> |
451
+
452
+ **Returns:** <code>Promise&lt;<a href="#createreferrershortlinkresult">CreateReferrerShortLinkResult</a>&gt;</code>
453
+
454
+ **Since:** 0.1.0
455
+
456
+ --------------------
457
+
458
+
459
+ ### getGlobalProperties()
460
+
461
+ ```typescript
462
+ getGlobalProperties() => Promise<GetGlobalPropertiesResult>
463
+ ```
464
+
465
+ Get all global properties.
466
+
467
+ Only available on Android and iOS.
468
+
469
+ **Returns:** <code>Promise&lt;<a href="#getglobalpropertiesresult">GetGlobalPropertiesResult</a>&gt;</code>
470
+
471
+ **Since:** 0.1.0
472
+
473
+ --------------------
474
+
475
+
476
+ ### getLimitDataSharing()
477
+
478
+ ```typescript
479
+ getLimitDataSharing() => Promise<GetLimitDataSharingResult>
480
+ ```
481
+
482
+ Get whether data sharing is limited.
483
+
484
+ Only available on Android and iOS.
485
+
486
+ **Returns:** <code>Promise&lt;<a href="#getlimitdatasharingresult">GetLimitDataSharingResult</a>&gt;</code>
487
+
488
+ **Since:** 0.1.0
489
+
490
+ --------------------
491
+
492
+
493
+ ### initialize(...)
494
+
495
+ ```typescript
496
+ initialize(options: InitializeOptions) => Promise<void>
497
+ ```
498
+
499
+ Initialize the Singular SDK and start the first session.
500
+
501
+ This method must be called before any other method.
502
+ Add your listeners before calling this method so that no
503
+ deferred deep link or attribution event is missed.
504
+
505
+ Only available on Android and iOS.
506
+
507
+ | Param | Type |
508
+ | ------------- | --------------------------------------------------------------- |
509
+ | **`options`** | <code><a href="#initializeoptions">InitializeOptions</a></code> |
510
+
511
+ **Since:** 0.1.0
512
+
513
+ --------------------
514
+
515
+
516
+ ### isAllTrackingStopped()
517
+
518
+ ```typescript
519
+ isAllTrackingStopped() => Promise<IsAllTrackingStoppedResult>
520
+ ```
521
+
522
+ Get whether all tracking has been stopped via `stopAllTracking()`.
523
+
524
+ Only available on Android and iOS.
525
+
526
+ **Returns:** <code>Promise&lt;<a href="#isalltrackingstoppedresult">IsAllTrackingStoppedResult</a>&gt;</code>
527
+
528
+ **Since:** 0.1.0
529
+
530
+ --------------------
531
+
532
+
533
+ ### resumeAllTracking()
534
+
535
+ ```typescript
536
+ resumeAllTracking() => Promise<void>
537
+ ```
538
+
539
+ Resume all tracking after it was stopped via `stopAllTracking()`.
540
+
541
+ Only available on Android and iOS.
542
+
543
+ **Since:** 0.1.0
544
+
545
+ --------------------
546
+
547
+
548
+ ### setCustomUserId(...)
549
+
550
+ ```typescript
551
+ setCustomUserId(options: SetCustomUserIdOptions) => Promise<void>
552
+ ```
553
+
554
+ Set the custom user ID that is attached to all sessions and events.
555
+
556
+ Only available on Android and iOS.
557
+
558
+ | Param | Type |
559
+ | ------------- | ------------------------------------------------------------------------- |
560
+ | **`options`** | <code><a href="#setcustomuseridoptions">SetCustomUserIdOptions</a></code> |
561
+
562
+ **Since:** 0.1.0
563
+
564
+ --------------------
565
+
566
+
567
+ ### setDeviceToken(...)
568
+
569
+ ```typescript
570
+ setDeviceToken(options: SetDeviceTokenOptions) => Promise<void>
571
+ ```
572
+
573
+ Set the push notification device token used for uninstall tracking.
574
+
575
+ Only available on Android and iOS.
576
+
577
+ | Param | Type |
578
+ | ------------- | ----------------------------------------------------------------------- |
579
+ | **`options`** | <code><a href="#setdevicetokenoptions">SetDeviceTokenOptions</a></code> |
580
+
581
+ **Since:** 0.1.0
582
+
583
+ --------------------
584
+
585
+
586
+ ### setGlobalProperty(...)
587
+
588
+ ```typescript
589
+ setGlobalProperty(options: SetGlobalPropertyOptions) => Promise<void>
590
+ ```
591
+
592
+ Set a global property that is attached to all events.
593
+
594
+ At most 5 global properties can be set.
595
+ The call is rejected if the property could not be set.
596
+
597
+ Only available on Android and iOS.
598
+
599
+ | Param | Type |
600
+ | ------------- | ----------------------------------------------------------------------------- |
601
+ | **`options`** | <code><a href="#setglobalpropertyoptions">SetGlobalPropertyOptions</a></code> |
602
+
603
+ **Since:** 0.1.0
604
+
605
+ --------------------
606
+
607
+
608
+ ### setLimitAdvertisingIdentifiers(...)
609
+
610
+ ```typescript
611
+ setLimitAdvertisingIdentifiers(options: SetLimitAdvertisingIdentifiersOptions) => Promise<void>
612
+ ```
613
+
614
+ Set whether the SDK is allowed to collect advertising identifiers
615
+ (e.g. the Google Advertising ID or the IDFA).
616
+
617
+ Only available on Android and iOS.
618
+
619
+ | Param | Type |
620
+ | ------------- | ------------------------------------------------------------------------------------------------------- |
621
+ | **`options`** | <code><a href="#setlimitadvertisingidentifiersoptions">SetLimitAdvertisingIdentifiersOptions</a></code> |
622
+
623
+ **Since:** 0.1.0
624
+
625
+ --------------------
626
+
627
+
628
+ ### setLimitDataSharing(...)
629
+
630
+ ```typescript
631
+ setLimitDataSharing(options: SetLimitDataSharingOptions) => Promise<void>
632
+ ```
633
+
634
+ Set whether data sharing with third parties is limited
635
+ (e.g. after the user opted out under CCPA).
636
+
637
+ Only available on Android and iOS.
638
+
639
+ | Param | Type |
640
+ | ------------- | --------------------------------------------------------------------------------- |
641
+ | **`options`** | <code><a href="#setlimitdatasharingoptions">SetLimitDataSharingOptions</a></code> |
642
+
643
+ **Since:** 0.1.0
644
+
645
+ --------------------
646
+
647
+
648
+ ### skanGetConversionValue()
649
+
650
+ ```typescript
651
+ skanGetConversionValue() => Promise<SkanGetConversionValueResult>
652
+ ```
653
+
654
+ Get the current SKAdNetwork conversion value.
655
+
656
+ Only available on iOS.
657
+
658
+ **Returns:** <code>Promise&lt;<a href="#skangetconversionvalueresult">SkanGetConversionValueResult</a>&gt;</code>
659
+
660
+ **Since:** 0.1.0
661
+
662
+ --------------------
663
+
664
+
665
+ ### skanRegisterAppForAdNetworkAttribution()
666
+
667
+ ```typescript
668
+ skanRegisterAppForAdNetworkAttribution() => Promise<void>
669
+ ```
670
+
671
+ Register the app for SKAdNetwork attribution.
672
+
673
+ Only required if `iosManualSkanConversionManagement` is enabled.
674
+
675
+ Only available on iOS.
676
+
677
+ **Since:** 0.1.0
678
+
679
+ --------------------
680
+
681
+
682
+ ### skanUpdateConversionValue(...)
683
+
684
+ ```typescript
685
+ skanUpdateConversionValue(options: SkanUpdateConversionValueOptions) => Promise<void>
686
+ ```
687
+
688
+ Update the SKAdNetwork conversion value.
689
+
690
+ Only required if `iosManualSkanConversionManagement` is enabled.
691
+ The call is rejected if the conversion value could not be updated.
692
+
693
+ Only available on iOS.
694
+
695
+ | Param | Type |
696
+ | ------------- | --------------------------------------------------------------------------------------------- |
697
+ | **`options`** | <code><a href="#skanupdateconversionvalueoptions">SkanUpdateConversionValueOptions</a></code> |
698
+
699
+ **Since:** 0.1.0
700
+
701
+ --------------------
702
+
703
+
704
+ ### stopAllTracking()
705
+
706
+ ```typescript
707
+ stopAllTracking() => Promise<void>
708
+ ```
709
+
710
+ Stop all tracking.
711
+
712
+ This setting persists across app restarts until `resumeAllTracking()` is called.
713
+
714
+ Only available on Android and iOS.
715
+
716
+ **Since:** 0.1.0
717
+
718
+ --------------------
719
+
720
+
721
+ ### trackAdRevenue(...)
722
+
723
+ ```typescript
724
+ trackAdRevenue(options: TrackAdRevenueOptions) => Promise<void>
725
+ ```
726
+
727
+ Track ad revenue.
728
+
729
+ Only available on Android and iOS.
730
+
731
+ | Param | Type |
732
+ | ------------- | ----------------------------------------------------------------------- |
733
+ | **`options`** | <code><a href="#trackadrevenueoptions">TrackAdRevenueOptions</a></code> |
734
+
735
+ **Since:** 0.1.0
736
+
737
+ --------------------
738
+
739
+
740
+ ### trackEvent(...)
741
+
742
+ ```typescript
743
+ trackEvent(options: TrackEventOptions) => Promise<void>
744
+ ```
745
+
746
+ Track an event.
747
+
748
+ Only available on Android and iOS.
749
+
750
+ | Param | Type |
751
+ | ------------- | --------------------------------------------------------------- |
752
+ | **`options`** | <code><a href="#trackeventoptions">TrackEventOptions</a></code> |
753
+
754
+ **Since:** 0.1.0
755
+
756
+ --------------------
757
+
758
+
759
+ ### trackRevenue(...)
760
+
761
+ ```typescript
762
+ trackRevenue(options: TrackRevenueOptions) => Promise<void>
763
+ ```
764
+
765
+ Track a revenue event.
766
+
767
+ Only available on Android and iOS.
768
+
769
+ | Param | Type |
770
+ | ------------- | ------------------------------------------------------------------- |
771
+ | **`options`** | <code><a href="#trackrevenueoptions">TrackRevenueOptions</a></code> |
772
+
773
+ **Since:** 0.1.0
774
+
775
+ --------------------
776
+
777
+
778
+ ### trackingOptIn()
779
+
780
+ ```typescript
781
+ trackingOptIn() => Promise<void>
782
+ ```
783
+
784
+ Notify the SDK that the user has opted in to tracking (e.g. under GDPR).
785
+
786
+ Only available on Android and iOS.
787
+
788
+ **Since:** 0.1.0
789
+
790
+ --------------------
791
+
792
+
793
+ ### trackingUnder13()
794
+
795
+ ```typescript
796
+ trackingUnder13() => Promise<void>
797
+ ```
798
+
799
+ Notify the SDK that the user is under 13 years old
800
+ so that the SDK does not collect advertising identifiers.
801
+
802
+ Only available on Android and iOS.
803
+
804
+ **Since:** 0.1.0
805
+
806
+ --------------------
807
+
808
+
809
+ ### unsetCustomUserId()
810
+
811
+ ```typescript
812
+ unsetCustomUserId() => Promise<void>
813
+ ```
814
+
815
+ Remove the custom user ID.
816
+
817
+ Only available on Android and iOS.
818
+
819
+ **Since:** 0.1.0
820
+
821
+ --------------------
822
+
823
+
824
+ ### unsetGlobalProperty(...)
825
+
826
+ ```typescript
827
+ unsetGlobalProperty(options: UnsetGlobalPropertyOptions) => Promise<void>
828
+ ```
829
+
830
+ Remove a global property.
831
+
832
+ Only available on Android and iOS.
833
+
834
+ | Param | Type |
835
+ | ------------- | --------------------------------------------------------------------------------- |
836
+ | **`options`** | <code><a href="#unsetglobalpropertyoptions">UnsetGlobalPropertyOptions</a></code> |
837
+
838
+ **Since:** 0.1.0
839
+
840
+ --------------------
841
+
842
+
843
+ ### addListener('deviceAttributionInfoReceived', ...)
844
+
845
+ ```typescript
846
+ addListener(eventName: 'deviceAttributionInfoReceived', listenerFunc: (event: DeviceAttributionInfoReceivedEvent) => void) => Promise<PluginListenerHandle>
847
+ ```
848
+
849
+ Add a listener for when the device attribution information is received.
850
+
851
+ The event is emitted once after the first session, and only if
852
+ device attribution is enabled for your Singular account.
853
+
854
+ Only available on Android and iOS.
855
+
856
+ | Param | Type |
857
+ | ------------------ | --------------------------------------------------------------------------------------------------------------------- |
858
+ | **`eventName`** | <code>'deviceAttributionInfoReceived'</code> |
859
+ | **`listenerFunc`** | <code>(event: <a href="#deviceattributioninforeceivedevent">DeviceAttributionInfoReceivedEvent</a>) =&gt; void</code> |
860
+
861
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
862
+
863
+ **Since:** 0.1.0
864
+
865
+ --------------------
866
+
867
+
868
+ ### addListener('sdidReceived', ...)
869
+
870
+ ```typescript
871
+ addListener(eventName: 'sdidReceived', listenerFunc: (event: SdidReceivedEvent) => void) => Promise<PluginListenerHandle>
872
+ ```
873
+
874
+ Add a listener for when the Singular Device ID (SDID) is received.
875
+
876
+ The event is emitted after the first session and on every
877
+ subsequent launch with the stored SDID.
878
+
879
+ Only available on Android and iOS.
880
+
881
+ | Param | Type |
882
+ | ------------------ | ----------------------------------------------------------------------------------- |
883
+ | **`eventName`** | <code>'sdidReceived'</code> |
884
+ | **`listenerFunc`** | <code>(event: <a href="#sdidreceivedevent">SdidReceivedEvent</a>) =&gt; void</code> |
885
+
886
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
887
+
888
+ **Since:** 0.1.0
889
+
890
+ --------------------
891
+
892
+
893
+ ### addListener('sdidSet', ...)
894
+
895
+ ```typescript
896
+ addListener(eventName: 'sdidSet', listenerFunc: (event: SdidSetEvent) => void) => Promise<PluginListenerHandle>
897
+ ```
898
+
899
+ Add a listener for when a custom Singular Device ID (SDID) has been stored.
900
+
901
+ Only available on Android and iOS.
902
+
903
+ | Param | Type |
904
+ | ------------------ | ------------------------------------------------------------------------- |
905
+ | **`eventName`** | <code>'sdidSet'</code> |
906
+ | **`listenerFunc`** | <code>(event: <a href="#sdidsetevent">SdidSetEvent</a>) =&gt; void</code> |
907
+
908
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
909
+
910
+ **Since:** 0.1.0
911
+
912
+ --------------------
913
+
914
+
915
+ ### addListener('singularLinkResolved', ...)
916
+
917
+ ```typescript
918
+ addListener(eventName: 'singularLinkResolved', listenerFunc: (event: SingularLinkResolvedEvent) => void) => Promise<PluginListenerHandle>
919
+ ```
920
+
921
+ Add a listener for when a Singular Link is resolved.
922
+
923
+ This includes deferred deep links after an install.
924
+
925
+ Only available on Android and iOS.
926
+
927
+ | Param | Type |
928
+ | ------------------ | --------------------------------------------------------------------------------------------------- |
929
+ | **`eventName`** | <code>'singularLinkResolved'</code> |
930
+ | **`listenerFunc`** | <code>(event: <a href="#singularlinkresolvedevent">SingularLinkResolvedEvent</a>) =&gt; void</code> |
931
+
932
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
933
+
934
+ **Since:** 0.1.0
935
+
936
+ --------------------
937
+
938
+
939
+ ### addListener('skanConversionValueUpdated', ...)
940
+
941
+ ```typescript
942
+ addListener(eventName: 'skanConversionValueUpdated', listenerFunc: (event: SkanConversionValueUpdatedEvent) => void) => Promise<PluginListenerHandle>
943
+ ```
944
+
945
+ Add a listener for when the SDK updates the SKAdNetwork conversion value.
946
+
947
+ Only available on iOS.
948
+
949
+ | Param | Type |
950
+ | ------------------ | --------------------------------------------------------------------------------------------------------------- |
951
+ | **`eventName`** | <code>'skanConversionValueUpdated'</code> |
952
+ | **`listenerFunc`** | <code>(event: <a href="#skanconversionvalueupdatedevent">SkanConversionValueUpdatedEvent</a>) =&gt; void</code> |
953
+
954
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
955
+
956
+ **Since:** 0.1.0
957
+
958
+ --------------------
959
+
960
+
961
+ ### removeAllListeners()
962
+
963
+ ```typescript
964
+ removeAllListeners() => Promise<void>
965
+ ```
966
+
967
+ Remove all listeners for this plugin.
968
+
969
+ **Since:** 0.1.0
970
+
971
+ --------------------
972
+
973
+
974
+ ### Interfaces
975
+
976
+
977
+ #### CreateReferrerShortLinkResult
978
+
979
+ | Prop | Type | Description | Since |
980
+ | ---------- | ------------------- | ------------------------- | ----- |
981
+ | **`link`** | <code>string</code> | The generated short link. | 0.1.0 |
982
+
983
+
984
+ #### CreateReferrerShortLinkOptions
985
+
986
+ | Prop | Type | Description | Since |
987
+ | --------------------------- | ----------------------------------------- | ------------------------------------------------------------------- | ----- |
988
+ | **`baseLink`** | <code>string</code> | The Singular Link to shorten. | 0.1.0 |
989
+ | **`passthroughParameters`** | <code>Record&lt;string, string&gt;</code> | Additional parameters that are passed through to the installed app. | 0.1.0 |
990
+ | **`referrerId`** | <code>string</code> | The unique identifier of the referring user. | 0.1.0 |
991
+ | **`referrerName`** | <code>string</code> | The name of the referring user. | 0.1.0 |
992
+
993
+
994
+ #### GetGlobalPropertiesResult
995
+
996
+ | Prop | Type | Description | Since |
997
+ | ---------------- | ----------------------------------------- | ---------------------- | ----- |
998
+ | **`properties`** | <code>Record&lt;string, string&gt;</code> | The global properties. | 0.1.0 |
999
+
1000
+
1001
+ #### GetLimitDataSharingResult
1002
+
1003
+ | Prop | Type | Description | Since |
1004
+ | ----------- | -------------------- | -------------------------------- | ----- |
1005
+ | **`limit`** | <code>boolean</code> | Whether data sharing is limited. | 0.1.0 |
1006
+
1007
+
1008
+ #### InitializeOptions
1009
+
1010
+ | Prop | Type | Description | Default | Since |
1011
+ | -------------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- |
1012
+ | **`androidFacebookAppId`** | <code>string</code> | The Facebook App ID used for Meta Install Referrer attribution. Only available on Android. | | 0.1.0 |
1013
+ | **`apiKey`** | <code>string</code> | The SDK key of your Singular account. | | 0.1.0 |
1014
+ | **`brandedDomains`** | <code>string[]</code> | The branded domains that should be resolved as Singular Links. | | 0.1.0 |
1015
+ | **`customSdid`** | <code>string</code> | A custom Singular Device ID (SDID) that is used instead of the one generated by Singular. | | 0.1.0 |
1016
+ | **`customUserId`** | <code>string</code> | The custom user ID that is attached to all sessions and events. | | 0.1.0 |
1017
+ | **`espDomains`** | <code>string[]</code> | The email service provider domains that should be resolved as Singular Links. | | 0.1.0 |
1018
+ | **`globalProperties`** | <code>Record&lt;string, string&gt;</code> | Global properties that are attached to all events. Existing global properties with the same key are overridden. At most 5 global properties can be set. | | 0.1.0 |
1019
+ | **`iosManualSkanConversionManagement`** | <code>boolean</code> | Whether the SKAdNetwork conversion value is managed by your app instead of by the SDK. Only available on iOS. | <code>false</code> | 0.1.0 |
1020
+ | **`iosSkAdNetworkEnabled`** | <code>boolean</code> | Whether SKAdNetwork support is enabled. Only available on iOS. | <code>true</code> | 0.1.0 |
1021
+ | **`iosWaitForTrackingAuthorizationTimeout`** | <code>number</code> | The number of seconds the SDK waits for the App Tracking Transparency authorization before sending the first session. Set this to a value greater than `0` if you request the tracking authorization right after the app launch. Only available on iOS. | <code>0</code> | 0.1.0 |
1022
+ | **`limitAdvertisingIdentifiers`** | <code>boolean</code> | Whether the SDK is not allowed to collect advertising identifiers (e.g. the Google Advertising ID or the IDFA). | <code>false</code> | 0.1.0 |
1023
+ | **`limitDataSharing`** | <code>boolean</code> | Whether data sharing with third parties is limited. | <code>false</code> | 0.1.0 |
1024
+ | **`loggingEnabled`** | <code>boolean</code> | Whether debug logging is enabled. | <code>false</code> | 0.1.0 |
1025
+ | **`secret`** | <code>string</code> | The SDK secret of your Singular account. | | 0.1.0 |
1026
+ | **`sessionTimeout`** | <code>number</code> | The number of seconds the app can stay in the background before a new session is started. | <code>60</code> | 0.1.0 |
1027
+ | **`shortLinkResolveTimeout`** | <code>number</code> | The number of seconds the SDK waits for a short link to be resolved. | <code>10</code> | 0.1.0 |
1028
+
1029
+
1030
+ #### IsAllTrackingStoppedResult
1031
+
1032
+ | Prop | Type | Description | Since |
1033
+ | ------------- | -------------------- | -------------------------------------- | ----- |
1034
+ | **`stopped`** | <code>boolean</code> | Whether all tracking has been stopped. | 0.1.0 |
1035
+
1036
+
1037
+ #### SetCustomUserIdOptions
1038
+
1039
+ | Prop | Type | Description | Since |
1040
+ | ------------------ | ------------------- | ------------------- | ----- |
1041
+ | **`customUserId`** | <code>string</code> | The custom user ID. | 0.1.0 |
1042
+
1043
+
1044
+ #### SetDeviceTokenOptions
1045
+
1046
+ | Prop | Type | Description | Since |
1047
+ | ----------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ----- |
1048
+ | **`token`** | <code>string</code> | The push notification device token. On Android, this is the FCM registration token. On iOS, this is the hex-encoded APNs device token. | 0.1.0 |
1049
+
1050
+
1051
+ #### SetGlobalPropertyOptions
1052
+
1053
+ | Prop | Type | Description | Default | Since |
1054
+ | ---------------------- | -------------------- | -------------------------------------------------------------------- | ----------------- | ----- |
1055
+ | **`key`** | <code>string</code> | The key of the global property. | | 0.1.0 |
1056
+ | **`overrideExisting`** | <code>boolean</code> | Whether an existing global property with the same key is overridden. | <code>true</code> | 0.1.0 |
1057
+ | **`value`** | <code>string</code> | The value of the global property. | | 0.1.0 |
1058
+
1059
+
1060
+ #### SetLimitAdvertisingIdentifiersOptions
1061
+
1062
+ | Prop | Type | Description | Since |
1063
+ | ----------- | -------------------- | ------------------------------------------------------------------ | ----- |
1064
+ | **`limit`** | <code>boolean</code> | Whether the SDK is not allowed to collect advertising identifiers. | 0.1.0 |
1065
+
1066
+
1067
+ #### SetLimitDataSharingOptions
1068
+
1069
+ | Prop | Type | Description | Since |
1070
+ | ----------- | -------------------- | --------------------------------------------------- | ----- |
1071
+ | **`limit`** | <code>boolean</code> | Whether data sharing with third parties is limited. | 0.1.0 |
1072
+
1073
+
1074
+ #### SkanGetConversionValueResult
1075
+
1076
+ | Prop | Type | Description | Since |
1077
+ | ----------- | --------------------------- | -------------------------------------------------------------------------------------- | ----- |
1078
+ | **`value`** | <code>number \| null</code> | The fine-grained conversion value (`0` - `63`) or `null` if no value has been set yet. | 0.1.0 |
1079
+
1080
+
1081
+ #### SkanUpdateConversionValueOptions
1082
+
1083
+ | Prop | Type | Description | Default | Since |
1084
+ | ----------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ------------------ | ----- |
1085
+ | **`coarseValue`** | <code><a href="#skancoarseconversionvalue">SkanCoarseConversionValue</a></code> | The coarse conversion value. Only available on iOS 16.1+. | | 0.1.0 |
1086
+ | **`lockWindow`** | <code>boolean</code> | Whether the conversion window should be locked. Only available on iOS 16.1+. | <code>false</code> | 0.1.0 |
1087
+ | **`value`** | <code>number</code> | The fine-grained conversion value (`0` - `63`). | | 0.1.0 |
1088
+
1089
+
1090
+ #### TrackAdRevenueOptions
1091
+
1092
+ | Prop | Type | Description | Since |
1093
+ | --------------------- | ------------------- | ---------------------------------------------------- | ----- |
1094
+ | **`adGroupId`** | <code>string</code> | The identifier of the ad group. | 0.1.0 |
1095
+ | **`adGroupName`** | <code>string</code> | The name of the ad group. | 0.1.0 |
1096
+ | **`adGroupPriority`** | <code>string</code> | The priority of the ad group. | 0.1.0 |
1097
+ | **`adGroupType`** | <code>string</code> | The type of the ad group. | 0.1.0 |
1098
+ | **`adPlacementName`** | <code>string</code> | The name of the ad placement. | 0.1.0 |
1099
+ | **`adPlatform`** | <code>string</code> | The ad mediation platform that reported the revenue. | 0.1.0 |
1100
+ | **`adType`** | <code>string</code> | The type of the ad. | 0.1.0 |
1101
+ | **`adUnitId`** | <code>string</code> | The identifier of the ad unit. | 0.1.0 |
1102
+ | **`adUnitName`** | <code>string</code> | The name of the ad unit. | 0.1.0 |
1103
+ | **`currency`** | <code>string</code> | The currency of the revenue as ISO 4217 code. | 0.1.0 |
1104
+ | **`impressionId`** | <code>string</code> | The identifier of the ad impression. | 0.1.0 |
1105
+ | **`networkName`** | <code>string</code> | The name of the ad network that served the ad. | 0.1.0 |
1106
+ | **`placementId`** | <code>string</code> | The identifier of the placement. | 0.1.0 |
1107
+ | **`precision`** | <code>string</code> | The precision of the reported revenue. | 0.1.0 |
1108
+ | **`revenue`** | <code>number</code> | The revenue amount. | 0.1.0 |
1109
+
1110
+
1111
+ #### TrackEventOptions
1112
+
1113
+ | Prop | Type | Description | Since |
1114
+ | ---------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
1115
+ | **`attributes`** | <code>Record&lt;string, string \| number \| boolean&gt;</code> | The attributes of the event. Attribute keys and values are limited to 500 characters. | 0.1.0 |
1116
+ | **`name`** | <code>string</code> | The name of the event. Can be a standard event name (e.g. `sng_login`, `sng_tutorial_complete`) or a custom event name. Limited to 32 characters. | 0.1.0 |
1117
+
1118
+
1119
+ #### TrackRevenueOptions
1120
+
1121
+ | Prop | Type | Description | Since |
1122
+ | ---------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ----- |
1123
+ | **`amount`** | <code>number</code> | The revenue amount. | 0.1.0 |
1124
+ | **`attributes`** | <code>Record&lt;string, string \| number \| boolean&gt;</code> | The attributes of the event. | 0.1.0 |
1125
+ | **`currency`** | <code>string</code> | The currency of the revenue as ISO 4217 code. | 0.1.0 |
1126
+ | **`eventName`** | <code>string</code> | The name of the event. If provided, a custom revenue event with this name is tracked instead of the default revenue event. | 0.1.0 |
1127
+
1128
+
1129
+ #### UnsetGlobalPropertyOptions
1130
+
1131
+ | Prop | Type | Description | Since |
1132
+ | --------- | ------------------- | ------------------------------- | ----- |
1133
+ | **`key`** | <code>string</code> | The key of the global property. | 0.1.0 |
1134
+
1135
+
1136
+ #### PluginListenerHandle
1137
+
1138
+ | Prop | Type |
1139
+ | ------------ | ----------------------------------------- |
1140
+ | **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |
1141
+
1142
+
1143
+ #### DeviceAttributionInfoReceivedEvent
1144
+
1145
+ | Prop | Type | Description | Since |
1146
+ | --------------------- | ------------------- | --------------------------------------------------------------------------- | ----- |
1147
+ | **`campaignId`** | <code>string</code> | The identifier of the campaign. | 0.1.0 |
1148
+ | **`campaignName`** | <code>string</code> | The name of the campaign. | 0.1.0 |
1149
+ | **`clickTimestamp`** | <code>number</code> | The timestamp of the attributed click in milliseconds since the Unix epoch. | 0.1.0 |
1150
+ | **`creativeId`** | <code>string</code> | The identifier of the creative. | 0.1.0 |
1151
+ | **`creativeName`** | <code>string</code> | The name of the creative. | 0.1.0 |
1152
+ | **`matchType`** | <code>string</code> | The type of the attribution match. | 0.1.0 |
1153
+ | **`network`** | <code>string</code> | The name of the attributed network. | 0.1.0 |
1154
+ | **`passthrough`** | <code>string</code> | The passthrough parameters of the attributed link. | 0.1.0 |
1155
+ | **`subcampaignId`** | <code>string</code> | The identifier of the sub campaign. | 0.1.0 |
1156
+ | **`subcampaignName`** | <code>string</code> | The name of the sub campaign. | 0.1.0 |
1157
+
1158
+
1159
+ #### SdidReceivedEvent
1160
+
1161
+ | Prop | Type | Description | Since |
1162
+ | ---------- | ------------------- | ----------------------- | ----- |
1163
+ | **`sdid`** | <code>string</code> | The Singular Device ID. | 0.1.0 |
1164
+
1165
+
1166
+ #### SdidSetEvent
1167
+
1168
+ | Prop | Type | Description | Since |
1169
+ | ---------- | ------------------- | ----------------------- | ----- |
1170
+ | **`sdid`** | <code>string</code> | The Singular Device ID. | 0.1.0 |
1171
+
1172
+
1173
+ #### SingularLinkResolvedEvent
1174
+
1175
+ | Prop | Type | Description | Since |
1176
+ | ------------------- | ----------------------------------------- | -------------------------------------------------------------------------- | ----- |
1177
+ | **`deepLink`** | <code>string \| null</code> | The deep link value of the Singular Link. | 0.1.0 |
1178
+ | **`isDeferred`** | <code>boolean</code> | Whether the link is a deferred deep link (i.e. resolved after an install). | 0.1.0 |
1179
+ | **`passthrough`** | <code>string \| null</code> | The passthrough value of the Singular Link. | 0.1.0 |
1180
+ | **`urlParameters`** | <code>Record&lt;string, string&gt;</code> | The query parameters of the Singular Link. | 0.1.0 |
1181
+
1182
+
1183
+ #### SkanConversionValueUpdatedEvent
1184
+
1185
+ | Prop | Type | Description | Since |
1186
+ | ----------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ----- |
1187
+ | **`coarseValue`** | <code><a href="#skancoarseconversionvalue">SkanCoarseConversionValue</a> \| null</code> | The coarse conversion value. Only available on iOS 16.1+. | 0.1.0 |
1188
+ | **`lockWindow`** | <code>boolean</code> | Whether the conversion window is locked. Only available on iOS 16.1+. | 0.1.0 |
1189
+ | **`value`** | <code>number \| null</code> | The fine-grained conversion value (`0` - `63`). | 0.1.0 |
1190
+
1191
+
1192
+ ### Enums
1193
+
1194
+
1195
+ #### SkanCoarseConversionValue
1196
+
1197
+ | Members | Value | Since |
1198
+ | ------------ | --------------------- | ----- |
1199
+ | **`High`** | <code>'HIGH'</code> | 0.1.0 |
1200
+ | **`Low`** | <code>'LOW'</code> | 0.1.0 |
1201
+ | **`Medium`** | <code>'MEDIUM'</code> | 0.1.0 |
1202
+
1203
+ </docgen-api>
1204
+
1205
+ ## FAQ
1206
+
1207
+ ### Do I need a Singular account to use this plugin?
1208
+
1209
+ Yes. This plugin wraps the official Singular SDKs, which require a [Singular](https://www.singular.net/) account, an SDK key and an SDK secret.
1210
+
1211
+ ### Where do I find the SDK key and the SDK secret?
1212
+
1213
+ Both are available in the Singular dashboard under **Developer Tools → SDK Integration → SDK Keys**. Do not use the Singular Reporting API key, otherwise no SDK data is received.
1214
+
1215
+ ### Do I have to call `initialize(...)` before all other methods?
1216
+
1217
+ Yes. All other methods reject with the error code `NOT_INITIALIZED` until `initialize(...)` has been called.
1218
+
1219
+ ### Why should I add my listeners before calling `initialize(...)`?
1220
+
1221
+ The SDK resolves deferred deep links and reports the device attribution information during the first session. If you add the listeners after calling `initialize(...)`, these events may be emitted before your listeners are attached and are therefore missed.
1222
+
1223
+ ### Does `stopAllTracking()` persist across app restarts?
1224
+
1225
+ Yes. Tracking stays stopped until you call `resumeAllTracking()`, even if the app is restarted in between. You can check the current state with `isAllTrackingStopped()`.
1226
+
1227
+ ### Are there any limits for event names, attributes and global properties?
1228
+
1229
+ Yes. Event names are limited to 32 characters, attribute keys and values to 500 characters, and at most 5 global properties can be set. Currencies must be passed as upper case ISO 4217 codes (e.g. `USD`).
1230
+
1231
+ ### Do I have to handle deep links that open the app while it is already running?
1232
+
1233
+ No. The plugin handles warm starts for you by re-initializing the SDK with the new link so that the `singularLinkResolved` event is emitted. On Android, this requires the default `singleTask` launch mode of Capacitor's `MainActivity`.
1234
+
1235
+ ### Can I use this plugin with Ionic, React, Vue or Angular?
1236
+
1237
+ Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.
1238
+
1239
+ ## Related Plugins
1240
+
1241
+ - [App Tracking Transparency](https://capawesome.io/docs/sdks/capacitor/app-tracking-transparency/): Request the tracking permission required to collect the IDFA on iOS.
1242
+ - [Install Referrer](https://capawesome.io/docs/sdks/capacitor/install-referrer/): Read install attribution data from the Play Install Referrer and Apple Ad Services.
1243
+ - [PostHog](https://capawesome.io/docs/sdks/capacitor/posthog/): Unofficial Capacitor plugin for the PostHog product analytics platform.
1244
+ - [TikTok App Events](https://capawesome.io/docs/sdks/capacitor/tiktok-app-events/): Unofficial Capacitor plugin for the TikTok App Events SDK.
1245
+
1246
+ ## Newsletter
1247
+
1248
+ Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).
1249
+
1250
+ ## Changelog
1251
+
1252
+ See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/singular/CHANGELOG.md).
1253
+
1254
+ ## License
1255
+
1256
+ See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/singular/LICENSE).
1257
+
1258
+ ## Third-Party Notices
1259
+
1260
+ The Singular SDK for iOS is licensed under the [MIT license](https://github.com/singular-labs/Singular-iOS-SDK/blob/master/LICENSE) and is distributed via CocoaPods and Swift Package Manager. The Singular SDK for Android is distributed as a binary artifact from Singular's Maven repository and does not declare a license. Use of both SDKs is additionally governed by the [Singular Terms & Conditions of Service](https://www.singular.net/terms/), which limit the use of the service to your own advertising and promotions and prohibit sending Protected Health Information (as defined under HIPAA) to Singular. This plugin only declares these SDKs as dependencies and does not bundle or modify them. The MIT license of this plugin covers the wrapper code only, not the Singular SDKs.
1261
+
1262
+ [^1]: This project is not affiliated with, endorsed by, sponsored by, or approved by Singular Labs, Inc. or any of their affiliates or subsidiaries.