@datalyr/react-native 1.4.9 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +17 -127
  3. package/android/build.gradle +0 -7
  4. package/android/src/main/java/com/datalyr/reactnative/DatalyrNativeModule.java +2 -380
  5. package/android/src/main/java/com/datalyr/reactnative/DatalyrPackage.java +1 -1
  6. package/datalyr-react-native.podspec +3 -7
  7. package/expo-module.config.json +4 -1
  8. package/ios/DatalyrNativeModule.swift +0 -266
  9. package/lib/datalyr-sdk.d.ts +8 -4
  10. package/lib/datalyr-sdk.js +83 -143
  11. package/lib/http-client.js +2 -2
  12. package/lib/index.d.ts +1 -1
  13. package/lib/index.js +1 -1
  14. package/lib/integrations/index.d.ts +3 -4
  15. package/lib/integrations/index.js +3 -4
  16. package/lib/native/DatalyrNativeBridge.d.ts +6 -22
  17. package/lib/native/DatalyrNativeBridge.js +6 -147
  18. package/lib/native/index.d.ts +1 -1
  19. package/lib/native/index.js +1 -1
  20. package/lib/types.d.ts +1 -19
  21. package/package.json +3 -5
  22. package/src/datalyr-sdk-expo.ts +6 -141
  23. package/src/datalyr-sdk.ts +96 -173
  24. package/src/http-client.ts +2 -2
  25. package/src/index.ts +1 -1
  26. package/src/integrations/index.ts +3 -4
  27. package/src/native/DatalyrNativeBridge.ts +6 -241
  28. package/src/native/index.ts +0 -2
  29. package/src/types.ts +2 -25
  30. package/src/utils-expo.ts +2 -2
  31. package/ios/DatalyrObjCExceptionCatcher.h +0 -14
  32. package/ios/DatalyrObjCExceptionCatcher.m +0 -30
  33. package/lib/integrations/meta-integration.d.ts +0 -77
  34. package/lib/integrations/meta-integration.js +0 -219
  35. package/lib/integrations/tiktok-integration.d.ts +0 -83
  36. package/lib/integrations/tiktok-integration.js +0 -360
  37. package/src/integrations/meta-integration.ts +0 -239
  38. package/src/integrations/tiktok-integration.ts +0 -363
package/CHANGELOG.md CHANGED
@@ -5,6 +5,45 @@ All notable changes to the Datalyr React Native SDK will be documented in this f
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.6.0] - 2026-03
9
+
10
+ ### Removed
11
+ - **Meta (Facebook) SDK** - Removed FBSDKCoreKit (iOS) and facebook-android-sdk (Android) dependencies
12
+ - **TikTok Business SDK** - Removed TikTokBusinessSDK (iOS) and tiktok-business-android-sdk (Android) dependencies
13
+ - Removed ByteDance maven repository from Android build
14
+ - Removed `MetaConfig`, `TikTokConfig` TypeScript interfaces
15
+ - Removed `MetaNativeBridge`, `TikTokNativeBridge` native bridge modules
16
+ - Removed all client-side event forwarding to Meta/TikTok
17
+ - Removed `meta-integration.ts`, `tiktok-integration.ts`, `DatalyrObjCExceptionCatcher`
18
+
19
+ ### Changed
20
+ - Conversion event routing to Meta (CAPI), TikTok (Events API), and Google Ads is now handled entirely server-side via the Datalyr postback system
21
+ - IDFA/ATT and GAID now use native Apple/Google frameworks directly
22
+ - `getPlatformIntegrationStatus()` returns only `appleSearchAds` and `playInstallReferrer`
23
+
24
+ ### Migration from v1.5.x
25
+ Remove `meta` and `tiktok` config objects from your `initialize()` call:
26
+ ```typescript
27
+ // Before (v1.5.x)
28
+ await Datalyr.initialize({
29
+ apiKey: 'dk_...',
30
+ meta: { appId: 'FB_APP_ID', clientToken: '...' }, // REMOVE
31
+ tiktok: { appId: '...', tiktokAppId: '...' }, // REMOVE
32
+ });
33
+
34
+ // After (v1.6.0)
35
+ await Datalyr.initialize({
36
+ apiKey: 'dk_...',
37
+ });
38
+ ```
39
+ No other code changes needed. All tracking methods (`trackPurchase`, `trackAddToCart`, etc.) work the same — events are routed to ad platforms server-side via your Datalyr postback rules.
40
+
41
+ If you were importing `metaIntegration` or `tiktokIntegration` directly, remove those imports — they no longer exist.
42
+
43
+ iOS: Remove from Info.plist: `FacebookAppID`, `FacebookClientToken`, `FacebookDisplayName`, and `LSApplicationQueriesSchemes` entries for TikTok.
44
+
45
+ Android: No changes needed — Meta/TikTok dependencies are automatically removed on `pod install` / gradle sync.
46
+
8
47
  ## [1.3.1] - 2026-01
9
48
 
10
49
  ### Added
package/README.md CHANGED
@@ -18,13 +18,11 @@ Mobile analytics and attribution SDK for React Native and Expo. Track events, id
18
18
  - [User Properties](#user-properties)
19
19
  - [Attribution](#attribution)
20
20
  - [Automatic Capture](#automatic-capture)
21
- - [Deferred Deep Links](#deferred-deep-links)
21
+ - [Web-to-App Attribution](#web-to-app-attribution)
22
22
  - [Event Queue](#event-queue)
23
23
  - [Auto Events](#auto-events)
24
24
  - [SKAdNetwork](#skadnetwork)
25
25
  - [Platform Integrations](#platform-integrations)
26
- - [Meta](#meta-facebook)
27
- - [TikTok](#tiktok)
28
26
  - [Apple Search Ads](#apple-search-ads)
29
27
  - [Expo Support](#expo-support)
30
28
  - [TypeScript](#typescript)
@@ -45,38 +43,6 @@ npm install @datalyr/react-native
45
43
  cd ios && pod install
46
44
  ```
47
45
 
48
- This installs the SDK with bundled Meta and TikTok native SDKs.
49
-
50
- Add to `ios/YourApp/Info.plist`:
51
-
52
- ```xml
53
- <!-- Meta SDK -->
54
- <key>FacebookAppID</key>
55
- <string>YOUR_FACEBOOK_APP_ID</string>
56
- <key>FacebookClientToken</key>
57
- <string>YOUR_CLIENT_TOKEN</string>
58
- <key>FacebookDisplayName</key>
59
- <string>Your App Name</string>
60
-
61
- <key>CFBundleURLTypes</key>
62
- <array>
63
- <dict>
64
- <key>CFBundleURLSchemes</key>
65
- <array>
66
- <string>fbYOUR_FACEBOOK_APP_ID</string>
67
- </array>
68
- </dict>
69
- </array>
70
-
71
- <!-- TikTok SDK -->
72
- <key>LSApplicationQueriesSchemes</key>
73
- <array>
74
- <string>tiktok</string>
75
- <string>snssdk1180</string>
76
- <string>snssdk1233</string>
77
- </array>
78
- ```
79
-
80
46
  ### Android Setup
81
47
 
82
48
  No additional setup required.
@@ -170,9 +136,6 @@ await Datalyr.initialize({
170
136
  // iOS
171
137
  skadTemplate?: 'ecommerce' | 'gaming' | 'subscription',
172
138
 
173
- // Platform SDKs
174
- meta?: MetaConfig,
175
- tiktok?: TikTokConfig,
176
139
  });
177
140
  ```
178
141
 
@@ -220,7 +183,7 @@ await Datalyr.screen('Product Details', {
220
183
 
221
184
  ### E-Commerce Events
222
185
 
223
- Standard e-commerce events that also forward to Meta and TikTok:
186
+ Standard e-commerce events:
224
187
 
225
188
  ```typescript
226
189
  // View product
@@ -282,7 +245,6 @@ await Datalyr.identify('user_123', {
282
245
  After `identify()`:
283
246
  - All future events include `user_id`
284
247
  - Historical anonymous events can be linked server-side
285
- - User data is forwarded to Meta/TikTok for Advanced Matching
286
248
 
287
249
  ### User Properties
288
250
 
@@ -335,26 +297,22 @@ Captured parameters:
335
297
  | Click IDs | `fbclid`, `gclid`, `ttclid`, `twclid`, `li_click_id`, `msclkid` |
336
298
  | Campaign | `campaign_id`, `adset_id`, `ad_id` |
337
299
 
338
- ### Deferred Deep Links
300
+ ### Web-to-App Attribution
339
301
 
340
- Capture attribution from App Store installs (iOS):
302
+ Automatically recover attribution from a web prelander when users install the app from an ad.
341
303
 
342
- ```typescript
343
- await Datalyr.initialize({
344
- apiKey: 'dk_your_api_key',
345
- meta: {
346
- appId: '1234567890',
347
- enableDeferredDeepLink: true,
348
- },
349
- });
304
+ **How it works:**
305
+ - **Android**: Attribution params are passed through the Play Store `referrer` URL parameter (set by the web SDK's `trackAppDownloadClick()`). The mobile SDK reads these via the Play Install Referrer API — deterministic, ~95% accuracy.
306
+ - **iOS**: On first install, the SDK calls the Datalyr API to match the device's IP against recent `$app_download_click` web events within 24 hours — ~90%+ accuracy for immediate installs.
350
307
 
351
- // Check for deferred attribution
352
- const deferred = Datalyr.getDeferredAttributionData();
353
- if (deferred) {
354
- console.log(deferred.fbclid); // Facebook click ID
355
- console.log(deferred.campaignId); // Campaign ID
356
- }
357
- ```
308
+ No additional mobile code is needed. Attribution is recovered automatically during `initialize()` on first install, before the `app_install` event fires.
309
+
310
+ After a match, the SDK:
311
+ 1. Merges web attribution (click IDs, UTMs, cookies) into the mobile session
312
+ 2. Tracks a `$web_attribution_matched` event for analytics
313
+ 3. All subsequent events (including purchases) carry the matched attribution
314
+
315
+ **Fallback:** If IP matching misses (e.g., VPN toggle during install), email-based attribution is still recovered when `identify()` is called with the user's email.
358
316
 
359
317
  ### Manual Attribution
360
318
 
@@ -456,46 +414,7 @@ await Datalyr.trackPurchase(99.99, 'USD');
456
414
 
457
415
  ## Platform Integrations
458
416
 
459
- Bundled Meta and TikTok SDKs for iOS. No extra npm packages needed.
460
-
461
- ### Meta (Facebook)
462
-
463
- ```typescript
464
- await Datalyr.initialize({
465
- apiKey: 'dk_your_api_key',
466
- meta: {
467
- appId: '1234567890',
468
- clientToken: 'abc123',
469
- enableDeferredDeepLink: true,
470
- enableAppEvents: true,
471
- },
472
- });
473
- ```
474
-
475
- ### TikTok
476
-
477
- ```typescript
478
- await Datalyr.initialize({
479
- apiKey: 'dk_your_api_key',
480
- tiktok: {
481
- appId: 'your_app_id', // Events API App ID
482
- tiktokAppId: '7123456789', // TikTok App ID (Developer Portal)
483
- accessToken: 'your_access_token', // Events API Access Token
484
- enableAppEvents: true,
485
- },
486
- });
487
- ```
488
-
489
- **Where to find your TikTok credentials:**
490
-
491
- | Credential | Where to get it |
492
- |------------|----------------|
493
- | `tiktokAppId` | [TikTok Developer Portal](https://developers.tiktok.com) → Your App → App ID |
494
- | `appId` | TikTok Business Center → Assets → Events → Your App → App ID |
495
- | `accessToken` | TikTok Business Center → Assets → Events → Your App → Settings → Access Token |
496
-
497
- > **Note:** The `accessToken` enables client-side TikTok SDK features (enhanced attribution, real-time event forwarding). Without it, events are still tracked server-side via Datalyr postbacks — you'll see a warning in debug mode.
498
- ```
417
+ Conversion event routing to Meta, TikTok, and Google is handled server-side via the postback system. No client-side SDK configuration is needed for these platforms.
499
418
 
500
419
  ### Apple Search Ads
501
420
 
@@ -536,7 +455,7 @@ await Datalyr.updateTrackingAuthorization(status === 'granted');
536
455
 
537
456
  ```typescript
538
457
  const status = Datalyr.getPlatformIntegrationStatus();
539
- // { meta: true, tiktok: true, appleSearchAds: true }
458
+ // { appleSearchAds: true }
540
459
  ```
541
460
 
542
461
  ---
@@ -665,35 +584,6 @@ cd android && ./gradlew clean
665
584
  npx react-native run-android
666
585
  ```
667
586
 
668
- ### Meta SDK Not Working
669
-
670
- Verify Info.plist:
671
- ```xml
672
- <key>FacebookAppID</key>
673
- <string>YOUR_APP_ID</string>
674
- <key>FacebookClientToken</key>
675
- <string>YOUR_CLIENT_TOKEN</string>
676
- ```
677
-
678
- Check status: `Datalyr.getPlatformIntegrationStatus()`
679
-
680
- ### TikTok SDK Not Working
681
-
682
- 1. Make sure you have all three TikTok credentials (see [TikTok setup](#tiktok))
683
- 2. The `accessToken` is required for client-side SDK — without it, you'll see a warning but server-side tracking still works
684
- 3. Check status: `Datalyr.getPlatformIntegrationStatus()`
685
-
686
- ```typescript
687
- await Datalyr.initialize({
688
- apiKey: 'dk_your_api_key',
689
- tiktok: {
690
- appId: 'your_app_id',
691
- tiktokAppId: '7123456789012345',
692
- accessToken: 'your_access_token',
693
- },
694
- });
695
- ```
696
-
697
587
  ### SKAdNetwork Not Updating
698
588
 
699
589
  1. iOS 14.0+ required (16.1+ for SKAN 4.0)
@@ -36,19 +36,12 @@ android {
36
36
  repositories {
37
37
  google()
38
38
  mavenCentral()
39
- maven { url "https://artifact.bytedance.com/repository/pangle" } // TikTok SDK
40
39
  }
41
40
 
42
41
  dependencies {
43
42
  // React Native
44
43
  implementation "com.facebook.react:react-native:+"
45
44
 
46
- // Meta (Facebook) SDK - Updated Jan 2026
47
- implementation 'com.facebook.android:facebook-android-sdk:18.1.3'
48
-
49
- // TikTok Business SDK - Updated Jan 2026
50
- implementation 'com.tiktok.business.sdk:tiktok-business-android-sdk:1.6.0'
51
-
52
45
  // Google Play Install Referrer
53
46
  implementation 'com.android.installreferrer:installreferrer:2.2'
54
47