@tolinku/react-native-sdk 0.6.1 → 0.7.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.
package/README.md CHANGED
@@ -315,6 +315,64 @@ await Tolinku.destroy();
315
315
  | `onButtonPress` | Callback for button presses, including your own app's deep link scheme |
316
316
  | `onDismiss` | Callback for message dismissal |
317
317
 
318
+ ## Privacy
319
+
320
+ This package ships no `PrivacyInfo.xcprivacy`, and that is the correct answer
321
+ rather than a gap. It has no native iOS code: `android/` holds a small Java
322
+ module for the Play Install Referrer, and everything on iOS runs in JavaScript
323
+ over `fetch`. A privacy manifest is read out of a bundle, an iOS package has no
324
+ bundle unless it compiles something, and Apple requires a manifest of an SDK
325
+ that calls a required-reason API. This package calls none.
326
+
327
+ What could apply reaches you through a dependency that declares it itself.
328
+ `@react-native-async-storage/async-storage`, which we use for in-app message
329
+ dismissal state, impressions and last-shown timestamps, ships a manifest
330
+ declaring `NSPrivacyAccessedAPICategoryFileTimestamp` with reason `C617.1`,
331
+ checked against 3.1.1. Our peer range allows versions older than the manifest
332
+ requirement, so if you are pinned below 1.21 check your own copy rather than
333
+ taking this on trust. We add nothing to it either way.
334
+
335
+ If you are auditing us, the equivalent for our other packages is
336
+ `Sources/TolinkuSDK/PrivacyInfo.xcprivacy` in
337
+ [ios-sdk](https://github.com/tolinku/ios-sdk) and
338
+ `ios/tolinku/Sources/tolinku/PrivacyInfo.xcprivacy` in
339
+ [flutter-sdk](https://github.com/tolinku/flutter-sdk). Both declare
340
+ `NSPrivacyTracking` false.
341
+
342
+ ### Tracking
343
+
344
+ The SDK never reads the advertising identifier, never calls App Tracking
345
+ Transparency, and never joins a person's activity to data from another
346
+ company's apps or sites. Deferred matching compares coarse device signals
347
+ inside Tolinku and discards them. You do not need an ATT prompt on our account.
348
+
349
+ ### What the SDK sends, and which of your calls cause it
350
+
351
+ Apple's privacy label and Google's Data Safety form both ask you to describe
352
+ your dependencies. This is the table to fill them from. It covers the whole
353
+ surface, which is almost certainly more than your integration uses. Nothing is
354
+ sent on your behalf: `Tolinku.links.resolve` makes no analytics call, and
355
+ `trackLinkOpen` is something you invoke.
356
+
357
+ | Apple's category | Triggered by | What is sent |
358
+ |---|---|---|
359
+ | Other Data Types | `Tolinku.deferred.claimBySignals` | IANA timezone, BCP-47 language with region, screen size, pixel ratio, OS version. Compared against the signals recorded at click time, then discarded. Not linked to an identity. |
360
+ | Product Interaction | `trackLinkOpen`, `track`, and the ecommerce interaction events (`viewItem`, `addToCart`, `removeFromCart`, `viewCart`, `addToWishlist`, `share`, `rate`) | The event name and whatever properties you attach |
361
+ | Search History | `Tolinku.ecommerce.search` | The `search_term` you pass |
362
+ | Purchase History | `purchase`, `refund`, `beginCheckout` | Transaction id, revenue, currency, line items |
363
+ | User ID | `Tolinku.setUserId`, and the referral calls | Your own identifier for the person. The SDK never derives one |
364
+ | Name | The optional `userName` on the referral calls | A display name for a referral leaderboard. Omit it and nothing in this category is sent |
365
+
366
+ Everything above except Other Data Types is linked to identity once you call
367
+ `Tolinku.setUserId`, because the SDK then attaches `user_id` to every event. If
368
+ you never call it, those flows carry no identifier from us.
369
+
370
+ On Android, the Play Install Referrer is read through
371
+ `com.android.installreferrer`, which needs no permission. Our
372
+ `AndroidManifest.xml` declares none.
373
+
374
+ If you integrate only link resolution, none of the six apply to you.
375
+
318
376
  ## Documentation
319
377
 
320
378
  Full documentation is available at [tolinku.com/docs](https://tolinku.com/docs).
@@ -20,7 +20,7 @@ buildscript {
20
20
  mavenCentral()
21
21
  }
22
22
  dependencies {
23
- classpath("com.android.tools.build:gradle:8.1.4")
23
+ classpath("com.android.tools.build:gradle:9.5.1")
24
24
  }
25
25
  }
26
26
 
@@ -35,20 +35,28 @@ android {
35
35
  // namespace, so the old manifest package attribute is not needed.
36
36
  namespace "com.tolinku.rnsdk"
37
37
 
38
- compileSdkVersion safeExtGet("compileSdkVersion", 34)
38
+ // Property form, not compileSdkVersion(): the method was removed in AGP 9,
39
+ // and the property has existed since AGP 7.0, which is below the AGP 7.4
40
+ // that this package's React Native 0.72 floor ships with. So this reads
41
+ // correctly on every host in the supported range rather than only new ones.
42
+ compileSdk safeExtGet("compileSdkVersion", 36)
39
43
 
40
44
  defaultConfig {
41
45
  // The Install Referrer library needs 21; the host app decides above that.
42
- minSdkVersion safeExtGet("minSdkVersion", 21)
43
- targetSdkVersion safeExtGet("targetSdkVersion", 34)
46
+ minSdk safeExtGet("minSdkVersion", 21)
47
+ // Google Play has required targetSdk 36 since 31 August 2026, so a
48
+ // host that leaves this to the fallback should land on a value it can
49
+ // still publish with.
50
+ targetSdk safeExtGet("targetSdkVersion", 36)
44
51
  }
45
52
 
46
53
  compileOptions {
47
- sourceCompatibility JavaVersion.VERSION_1_8
48
- targetCompatibility JavaVersion.VERSION_1_8
54
+ sourceCompatibility JavaVersion.VERSION_11
55
+ targetCompatibility JavaVersion.VERSION_11
49
56
  }
50
57
 
51
- lintOptions {
58
+ // lint, not lintOptions: renamed in AGP 7.0 and removed in AGP 9.
59
+ lint {
52
60
  abortOnError false
53
61
  }
54
62
  }
@@ -11,7 +11,22 @@ import java.util.ArrayList;
11
11
  import java.util.Collections;
12
12
  import java.util.List;
13
13
 
14
- /** Registers the install referrer module with React Native's autolinking. */
14
+ /**
15
+ * Registers the install referrer module with React Native's autolinking.
16
+ *
17
+ * <p>Implements {@link ReactPackage} rather than extending {@code
18
+ * BaseReactPackage}, which is what React Native now recommends and why the
19
+ * compiler reports {@code createNativeModules} as deprecated from 0.88.
20
+ * {@code BaseReactPackage} arrived in React Native 0.74, and this package
21
+ * declares a peer range starting at 0.72, so adopting it would drop two
22
+ * versions of support to silence a warning. Deprecated is not removed: under
23
+ * the New Architecture this is carried by the interop layer and works, which
24
+ * the standalone Android build in CI compiles on 0.88 to confirm.
25
+ *
26
+ * <p>When the peer floor next rises above 0.74, extend {@code BaseReactPackage}
27
+ * and implement {@code getModule} plus {@code getReactModuleInfoProvider}
28
+ * instead. Until then this warning is expected and should be left alone.
29
+ */
15
30
  public class TolinkuInstallReferrerPackage implements ReactPackage {
16
31
 
17
32
  @Override
package/dist/index.d.mts CHANGED
@@ -450,7 +450,7 @@ declare class Links {
450
450
  * await Tolinku.track('signup', { source: 'onboarding' });
451
451
  */
452
452
  declare class Tolinku {
453
- static readonly VERSION = "0.6.1";
453
+ static readonly VERSION = "0.7.1";
454
454
  private static client;
455
455
  private static analyticsInstance;
456
456
  private static ecommerceInstance;
@@ -578,4 +578,5 @@ declare function TolinkuMessages({ trigger, triggerValue, onDismiss, onButtonPre
578
578
  */
579
579
  declare function isSafeUrl(url: string): boolean;
580
580
 
581
- export { type AddPaymentInfoParams, type AddToCartParams, type AddToWishlistParams, type BeginCheckoutParams, type ClaimBySignalsOptions, type CompleteReferralOptions, type CompleteReferralResult, type CreateReferralOptions, type CreateReferralResult, type DeferredLink, type EcommerceItem, type LeaderboardEntry, type Message, type MessageComponent, type MessageContent, type MilestoneOptions, type MilestoneResult, type PurchaseParams, type RateParams, type ReferralInfo, type ReferrerProvider, type RefundParams, type RemoveFromCartParams, type ResolvedLink, type ResolvedTolinkuConfig, type SearchParams, type ShareParams, type ShowMessageOptions, type SpendCreditsParams, Tolinku, type TolinkuConfig, TolinkuError, TolinkuMessages, type TrackProperties, type ViewItemParams, getInstallReferrerToken, isSafeUrl, parseInstallReferrer };
581
+ export { Tolinku, TolinkuError, TolinkuMessages, getInstallReferrerToken, isSafeUrl, parseInstallReferrer };
582
+ export type { AddPaymentInfoParams, AddToCartParams, AddToWishlistParams, BeginCheckoutParams, ClaimBySignalsOptions, CompleteReferralOptions, CompleteReferralResult, CreateReferralOptions, CreateReferralResult, DeferredLink, EcommerceItem, LeaderboardEntry, Message, MessageComponent, MessageContent, MilestoneOptions, MilestoneResult, PurchaseParams, RateParams, ReferralInfo, ReferrerProvider, RefundParams, RemoveFromCartParams, ResolvedLink, ResolvedTolinkuConfig, SearchParams, ShareParams, ShowMessageOptions, SpendCreditsParams, TolinkuConfig, TrackProperties, ViewItemParams };
package/dist/index.d.ts CHANGED
@@ -450,7 +450,7 @@ declare class Links {
450
450
  * await Tolinku.track('signup', { source: 'onboarding' });
451
451
  */
452
452
  declare class Tolinku {
453
- static readonly VERSION = "0.6.1";
453
+ static readonly VERSION = "0.7.1";
454
454
  private static client;
455
455
  private static analyticsInstance;
456
456
  private static ecommerceInstance;
@@ -578,4 +578,5 @@ declare function TolinkuMessages({ trigger, triggerValue, onDismiss, onButtonPre
578
578
  */
579
579
  declare function isSafeUrl(url: string): boolean;
580
580
 
581
- export { type AddPaymentInfoParams, type AddToCartParams, type AddToWishlistParams, type BeginCheckoutParams, type ClaimBySignalsOptions, type CompleteReferralOptions, type CompleteReferralResult, type CreateReferralOptions, type CreateReferralResult, type DeferredLink, type EcommerceItem, type LeaderboardEntry, type Message, type MessageComponent, type MessageContent, type MilestoneOptions, type MilestoneResult, type PurchaseParams, type RateParams, type ReferralInfo, type ReferrerProvider, type RefundParams, type RemoveFromCartParams, type ResolvedLink, type ResolvedTolinkuConfig, type SearchParams, type ShareParams, type ShowMessageOptions, type SpendCreditsParams, Tolinku, type TolinkuConfig, TolinkuError, TolinkuMessages, type TrackProperties, type ViewItemParams, getInstallReferrerToken, isSafeUrl, parseInstallReferrer };
581
+ export { Tolinku, TolinkuError, TolinkuMessages, getInstallReferrerToken, isSafeUrl, parseInstallReferrer };
582
+ export type { AddPaymentInfoParams, AddToCartParams, AddToWishlistParams, BeginCheckoutParams, ClaimBySignalsOptions, CompleteReferralOptions, CompleteReferralResult, CreateReferralOptions, CreateReferralResult, DeferredLink, EcommerceItem, LeaderboardEntry, Message, MessageComponent, MessageContent, MilestoneOptions, MilestoneResult, PurchaseParams, RateParams, ReferralInfo, ReferrerProvider, RefundParams, RemoveFromCartParams, ResolvedLink, ResolvedTolinkuConfig, SearchParams, ShareParams, ShowMessageOptions, SpendCreditsParams, TolinkuConfig, TrackProperties, ViewItemParams };
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ var AsyncStorage__default = /*#__PURE__*/_interopDefault(AsyncStorage);
11
11
  var React__default = /*#__PURE__*/_interopDefault(React);
12
12
 
13
13
  // src/types.ts
14
- var SDK_VERSION = "0.6.1";
14
+ var SDK_VERSION = "0.7.1";
15
15
 
16
16
  // src/debug.ts
17
17
  var _debugEnabled = false;
@@ -33,6 +33,9 @@ function debugWarn(message) {
33
33
  var MAX_RETRIES = 3;
34
34
  var BASE_DELAY_MS = 500;
35
35
  var MAX_JITTER_MS = 250;
36
+ function isAbortError(err) {
37
+ return typeof err === "object" && err !== null && err.name === "AbortError";
38
+ }
36
39
  var HttpClient = class {
37
40
  constructor(config) {
38
41
  /** Set of AbortControllers for in-flight requests. Used by destroy() to cancel all. */
@@ -187,7 +190,7 @@ var HttpClient = class {
187
190
  if (this.destroyed) {
188
191
  throw new TolinkuError("Tolinku: request aborted (client destroyed).", 0);
189
192
  }
190
- if (err instanceof DOMException && err.name === "AbortError") {
193
+ if (isAbortError(err)) {
191
194
  const timeoutErr = new TolinkuError(`Tolinku: request timed out after ${this.timeout}ms`, 0);
192
195
  if (attempt === MAX_RETRIES) throw timeoutErr;
193
196
  lastError = timeoutErr;
@@ -656,8 +659,9 @@ var Ecommerce = class {
656
659
  }
657
660
  }
658
661
  generateId() {
659
- if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
660
- return crypto.randomUUID();
662
+ const g = globalThis;
663
+ if (typeof g.crypto?.randomUUID === "function") {
664
+ return g.crypto.randomUUID();
661
665
  }
662
666
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
663
667
  const r = Math.random() * 16 | 0;