@datalyr/react-native 1.0.3 โ†’ 1.0.5

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/EXPO_INSTALL.md CHANGED
@@ -1,15 +1,14 @@
1
1
  # Datalyr Expo SDK - Installation Guide
2
2
 
3
- ## ๐ŸŽฏ Expo Compatibility Overview
3
+ ## Expo Compatibility
4
4
 
5
- **โœ… Works with Expo:** The Datalyr SDK can be used with Expo, but requires some adjustments for the **managed workflow**.
5
+ The Datalyr SDK works with all Expo workflows:
6
6
 
7
- **๐Ÿ“ฑ Expo Workflow Compatibility:**
8
- - โœ… **Expo Bare Workflow** - Full compatibility (use regular React Native SDK)
9
- - โœ… **Expo Managed Workflow** - Requires Expo-specific version (this guide)
10
- - โŒ **Expo Go** - Limited compatibility due to native dependencies
7
+ - **Expo Bare Workflow** - Full compatibility (use regular React Native SDK)
8
+ - **Expo Managed Workflow** - Requires Expo-specific setup (this guide)
9
+ - **Expo Go** - Limited compatibility due to native dependencies
11
10
 
12
- ## ๐Ÿš€ Quick Setup for Expo Managed Workflow
11
+ ## Quick Setup for Expo Managed Workflow
13
12
 
14
13
  ### 1. Install Expo Dependencies
15
14
 
@@ -131,7 +130,7 @@ const App: React.FC = () => {
131
130
  export default App;
132
131
  ```
133
132
 
134
- ## ๐Ÿ”ง Expo vs React Native CLI Differences
133
+ ## Expo vs React Native CLI Differences
135
134
 
136
135
  | Feature | React Native CLI | Expo Managed | Expo Bare |
137
136
  |---------|------------------|--------------|-----------|
@@ -142,7 +141,7 @@ export default App;
142
141
  | Attribution | Full support โœ… | Full support โœ… | Full support โœ… |
143
142
  | Auto Events | Full support โœ… | Full support โœ… | Full support โœ… |
144
143
 
145
- ## ๐Ÿ“ฑ Expo-Specific Features
144
+ ## Expo-Specific Features
146
145
 
147
146
  ### 1. Device Information
148
147
  ```typescript
@@ -186,7 +185,7 @@ const getNetworkType = async () => {
186
185
  };
187
186
  ```
188
187
 
189
- ## ๐ŸŽฏ Attribution Setup for Expo
188
+ ## Attribution Setup for Expo
190
189
 
191
190
  Deep links work the same way, but configuration is in `app.json`:
192
191
 
@@ -205,7 +204,7 @@ const tiktokUrl = 'yourappscheme://open?utm_source=tiktok&utm_campaign=viral_vid
205
204
  const googleUrl = 'yourappscheme://open?utm_source=google&utm_campaign=brand_search&gclid=google456def';
206
205
  ```
207
206
 
208
- ## ๐Ÿงช Testing with Expo
207
+ ## Testing with Expo
209
208
 
210
209
  ### Development
211
210
  ```bash
@@ -228,23 +227,23 @@ eas submit --platform ios
228
227
  eas submit --platform android
229
228
  ```
230
229
 
231
- ## โš ๏ธ Expo Limitations
230
+ ## Expo Limitations
232
231
 
233
- ### What Works Fully:
234
- - โœ… Event tracking and attribution
235
- - โœ… Session management
236
- - โœ… Screen view tracking
237
- - โœ… App lifecycle events
238
- - โœ… Deep link attribution
239
- - โœ… Basic device fingerprinting
232
+ ### What Works:
233
+ - Event tracking and attribution
234
+ - Session management
235
+ - Screen view tracking
236
+ - App lifecycle events
237
+ - Deep link attribution
238
+ - Basic device fingerprinting
240
239
 
241
- ### What Has Limitations:
242
- - โš ๏ธ **IDFA/GAID Collection** - Requires additional setup with expo-ads-admob
243
- - โš ๏ธ **Advanced Device Info** - Some properties not available in managed workflow
244
- - โš ๏ธ **Carrier Information** - Not available in managed workflow
245
- - โš ๏ธ **Custom Native Modules** - Can't use if staying in managed workflow
240
+ ### Limitations:
241
+ - **IDFA/GAID Collection** - Requires additional setup
242
+ - **Advanced Device Info** - Some properties not available in managed workflow
243
+ - **Carrier Information** - Not available in managed workflow
244
+ - **Custom Native Modules** - Not available in managed workflow
246
245
 
247
- ## ๐Ÿš€ Recommended Setup
246
+ ## Recommended Setup
248
247
 
249
248
  ### For Maximum Compatibility:
250
249
  1. **Use Expo Bare Workflow** - Get full React Native CLI features
@@ -255,24 +254,24 @@ eas submit --platform android
255
254
  2. **Core attribution still works** - LYR tags, UTM params, click IDs
256
255
  3. **Automatic events work fully** - Sessions, screen views, app lifecycle
257
256
 
258
- ## ๐Ÿ“Š Expected Events in Dashboard
257
+ ## Expected Events in Dashboard
259
258
 
260
259
  Events will appear in your Datalyr dashboard with `source: 'mobile_app'`:
261
260
 
262
- **๐Ÿ”ฅ Automatic Events:**
263
- - `session_start` - New user session (automatic)
264
- - `session_end` - Session ended with stats (automatic)
265
- - `pageviews` - Screen navigation (automatic)
266
- - `app_install` - First app launch with attribution (automatic)
267
- - `app_update` - App version changes (automatic)
268
- - `app_foreground`/`app_background` - App lifecycle (automatic)
269
- - `sdk_initialized` - SDK setup complete (automatic)
261
+ **Automatic Events:**
262
+ - `session_start` - New user session
263
+ - `session_end` - Session ended with stats
264
+ - `pageviews` - Screen navigation
265
+ - `app_install` - First app launch with attribution
266
+ - `app_update` - App version changes
267
+ - `app_foreground`/`app_background` - App lifecycle
268
+ - `sdk_initialized` - SDK setup complete
270
269
 
271
- **๐Ÿ“ฑ Manual Events:**
270
+ **Manual Events:**
272
271
  - Custom events from `datalyr.track()`
273
272
  - User identification from `datalyr.identify()`
274
273
 
275
- ## ๐Ÿ†š Expo vs React Native CLI Recommendation
274
+ ## Choosing Between Expo and React Native CLI
276
275
 
277
276
  ### Choose **React Native CLI** if:
278
277
  - You need full IDFA/GAID support
@@ -293,6 +292,6 @@ Events will appear in your Datalyr dashboard with `source: 'mobile_app'`:
293
292
 
294
293
  ---
295
294
 
296
- **๐ŸŽ‰ Ready to test? Your Expo app with automatic attribution is ready!**
295
+ **Ready to test?** Your Expo app with automatic attribution is ready!
297
296
 
298
- *The SDK provides 90% of the attribution value even with Expo limitations!*
297
+ The SDK provides 90% of the attribution value even with Expo's managed workflow limitations.
package/INSTALL.md CHANGED
@@ -1,33 +1,22 @@
1
- # Datalyr React Native SDK - Quick Install Guide
1
+ # Datalyr React Native SDK - Installation Guide
2
2
 
3
- ## ๐ŸŽฏ Key Features
3
+ ## Key Features
4
4
 
5
- - ๐Ÿš€ **NEW: SKAdNetwork Support** - Compete with AppsFlyer/Adjust at 90% cost savings
6
- - โœ… **Complete Attribution** - Track users from ad click to conversion
7
- - โœ… **Automatic Events** - Like Mixpanel (sessions, screen views, app lifecycle)
8
- - โœ… **Device Fingerprinting** - IDFA/GAID collection with fallback IDs
9
- - โœ… **Offline Support** - Queue events when offline, sync when connected
10
- - โœ… **Session Management** - Automatic session tracking with timeouts
11
- - โœ… **Deep Link Support** - Extract attribution from app launches
12
- - โœ… **Privacy Compliant** - GDPR/CCPA support with opt-out options
5
+ - **Complete Attribution** - Track users from ad click to conversion
6
+ - **Automatic Events** - Sessions, screen views, app lifecycle
7
+ - **SKAdNetwork Support** - iOS 14+ attribution
8
+ - **Offline Support** - Queue events when offline
9
+ - **Deep Link Support** - Extract attribution from app launches
10
+ - **Privacy Compliant** - GDPR/CCPA support
13
11
 
14
- ## ๐Ÿš€ Quick Setup (5 minutes)
12
+ ## Quick Setup
15
13
 
16
- ### 1. Install Dependencies
14
+ ### 1. Install Package
17
15
 
18
16
  ```bash
19
- # Navigate to your React Native project
20
- cd your-react-native-app
21
-
22
- # Install required dependencies
23
- npm install @react-native-async-storage/async-storage @react-native-community/netinfo react-native-device-info react-native-get-random-values react-native-idfa uuid
24
- # or with yarn
25
- yarn add @react-native-async-storage/async-storage @react-native-community/netinfo react-native-device-info react-native-get-random-values react-native-idfa uuid
26
-
27
- # Install dev dependencies
28
- npm install --save-dev @types/uuid
29
- # or with yarn
30
- yarn add --dev @types/uuid
17
+ npm install @datalyr/react-native
18
+ # or
19
+ yarn add @datalyr/react-native
31
20
  ```
32
21
 
33
22
  ### 2. iOS Setup (if targeting iOS)
@@ -36,19 +25,7 @@ yarn add --dev @types/uuid
36
25
  cd ios && pod install && cd ..
37
26
  ```
38
27
 
39
- ### 3. Add the SDK to Your Project
40
-
41
- For now, copy the SDK files directly into your project:
42
-
43
- ```bash
44
- # Create SDK directory
45
- mkdir -p src/datalyr-sdk
46
-
47
- # Copy SDK files
48
- cp -r docs/mobile/react-native/src/* src/datalyr-sdk/
49
- ```
50
-
51
- ### 4. Initialize in Your App
28
+ ### 3. Initialize in Your App
52
29
 
53
30
  **Basic Setup:**
54
31
  ```typescript
@@ -90,7 +67,7 @@ const App: React.FC = () => {
90
67
  };
91
68
  ```
92
69
 
93
- **๐Ÿš€ NEW: SKAdNetwork Setup (iOS 14+ Attribution):**
70
+ **SKAdNetwork Setup (iOS 14+ Attribution):**
94
71
  ```typescript
95
72
  // For iOS attribution competing with AppsFlyer/Adjust
96
73
  import React, { useEffect } from 'react';
@@ -148,7 +125,7 @@ const testTracking = async () => {
148
125
  };
149
126
  ```
150
127
 
151
- ## ๐Ÿ”ง Configuration Options
128
+ ## Configuration Options
152
129
 
153
130
  ```typescript
154
131
  await datalyr.initialize({
@@ -176,13 +153,13 @@ await datalyr.initialize({
176
153
  });
177
154
  ```
178
155
 
179
- ## ๐Ÿ“ฑ Platform Requirements
156
+ ## Platform Requirements
180
157
 
181
158
  - **React Native**: >= 0.60.0
182
159
  - **iOS**: >= 11.0
183
160
  - **Android**: >= API level 21
184
161
 
185
- ## ๐ŸŽฏ Framework Compatibility
162
+ ## Framework Compatibility
186
163
 
187
164
  | Framework | Compatibility | Install Guide |
188
165
  |-----------|---------------|---------------|
@@ -195,7 +172,7 @@ await datalyr.initialize({
195
172
 
196
173
  **๐Ÿ“– For Expo users:** See [EXPO_INSTALL.md](./EXPO_INSTALL.md) for Expo-specific setup instructions.
197
174
 
198
- ## ๐ŸŽฏ Setting Up Attribution
175
+ ## Setting Up Attribution
199
176
 
200
177
  ### 1. Configure Deep Links
201
178
 
@@ -267,7 +244,7 @@ Expected output:
267
244
  */
268
245
  ```
269
246
 
270
- ## ๐Ÿงช Testing Events
247
+ ## Testing Events
271
248
 
272
249
  After setup, events will appear in your Datalyr dashboard at:
273
250
  `https://app.datalyr.com/dashboard/ozLZblQ8hN`
@@ -292,7 +269,7 @@ Look for events with `source: 'mobile_app'` to confirm mobile tracking is workin
292
269
  - User identification with `datalyr.identify()`
293
270
  - Manual screen views with `datalyr.screen()`
294
271
 
295
- ## โšก Quick Debugging
272
+ ## Debugging
296
273
 
297
274
  ```typescript
298
275
  // Check SDK status
@@ -309,14 +286,14 @@ await datalyr.initialize({
309
286
  });
310
287
  ```
311
288
 
312
- ## ๐Ÿšจ Common Issues
289
+ ## Common Issues
313
290
 
314
291
  1. **Events not appearing**: Check debug logs and network connectivity
315
292
  2. **Build errors**: Ensure all dependencies are installed and linked
316
293
  3. **iOS build issues**: Run `cd ios && pod install`
317
294
  4. **Android issues**: Check that your minSdkVersion is >= 21
318
295
 
319
- ## ๐Ÿš€ Automatic Events Demo
296
+ ## Automatic Events
320
297
 
321
298
  Want to see all the automatic events in action? Check out `auto-events-example.tsx` for a live demo that shows:
322
299
 
@@ -343,7 +320,7 @@ await datalyr.trackRevenue('purchase', {
343
320
  await datalyr.endSession();
344
321
  ```
345
322
 
346
- ## ๐Ÿ“š Next Steps
323
+ ## Next Steps
347
324
 
348
325
  - See `example.tsx` for basic integration example
349
326
  - See `auto-events-example.tsx` for automatic events demo
@@ -353,7 +330,7 @@ await datalyr.endSession();
353
330
 
354
331
  ---
355
332
 
356
- ## ๐Ÿš€ SKAdNetwork Setup (iOS Attribution)
333
+ ## SKAdNetwork Setup (iOS Attribution)
357
334
 
358
335
  ### **1. Add Native Bridge (React Native CLI/Expo Bare)**
359
336
 
package/README.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # @datalyr/react-native
2
2
 
3
- Official Datalyr SDK for React Native & Expo - Server-side attribution tracking and analytics.
3
+ Official Datalyr SDK for React Native & Expo - Mobile attribution tracking and analytics.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@datalyr/react-native.svg)](https://www.npmjs.com/package/@datalyr/react-native)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
8
  ## Features
9
9
 
10
- - ๐Ÿ”’ **Server-side tracking** - Secure API key authentication
10
+ - ๐ŸŽฏ **Complete Attribution** - Track users from ad click to conversion
11
11
  - ๐Ÿ“ฑ **React Native & Expo** - Works with both platforms
12
- - ๐ŸŽฏ **Attribution tracking** - UTM, referrer, and deep links
12
+ - ๐Ÿ”„ **Automatic Events** - Session tracking, screen views, app lifecycle
13
13
  - ๐Ÿ“Š **SKAdNetwork** - iOS 14+ attribution support
14
- - ๐Ÿ’พ **Offline queue** - Events saved and retried
15
- - ๐Ÿ”„ **Session management** - Automatic session tracking
16
- - โšก **Performance** - < 100KB, minimal battery impact
14
+ - ๐Ÿ’พ **Offline Support** - Events saved and retried when reconnected
15
+ - ๐Ÿ”’ **Privacy First** - GDPR/CCPA compliant
16
+ - โšก **Lightweight** - < 100KB, minimal battery impact
17
17
 
18
18
  ## Installation
19
19
 
@@ -23,19 +23,16 @@ npm install @datalyr/react-native
23
23
  yarn add @datalyr/react-native
24
24
  ```
25
25
 
26
- ### Additional Dependencies
27
-
28
- For device information and attribution:
29
- ```bash
30
- npm install react-native-device-info @react-native-async-storage/async-storage
31
- ```
32
-
33
26
  ### iOS Setup
34
27
 
35
28
  ```bash
36
29
  cd ios && pod install
37
30
  ```
38
31
 
32
+ ### Expo Users
33
+
34
+ See [EXPO_INSTALL.md](./EXPO_INSTALL.md) for Expo-specific setup instructions.
35
+
39
36
  ## Quick Start
40
37
 
41
38
  ```typescript
@@ -44,9 +41,9 @@ import { Datalyr } from '@datalyr/react-native';
44
41
  // Initialize SDK
45
42
  await Datalyr.initialize({
46
43
  apiKey: 'dk_your_api_key', // Required - get from Datalyr dashboard
47
- debug: true, // Enable debug logs
48
- enableAutoEvents: true, // Track sessions, app lifecycle
49
- enableAttribution: true, // Track attribution data
44
+ debug: true, // Enable debug logs in development
45
+ enableAutoEvents: true, // Track sessions, screen views, app lifecycle
46
+ enableAttribution: true, // Track attribution data from ads
50
47
  });
51
48
 
52
49
  // Track custom event
@@ -16,7 +16,7 @@ import {
16
16
  TextInput,
17
17
  Linking,
18
18
  } from 'react-native';
19
- import { datalyr } from '@datalyr/react-native-sdk';
19
+ import { datalyr } from '@datalyr/react-native';
20
20
 
21
21
  const AttributionExample: React.FC = () => {
22
22
  const [attributionData, setAttributionData] = useState<any>(null);
@@ -9,7 +9,7 @@ import {
9
9
  AppState,
10
10
  SafeAreaView,
11
11
  } from 'react-native';
12
- import { datalyr } from '@datalyr/react-native-sdk';
12
+ import { datalyr } from '@datalyr/react-native';
13
13
 
14
14
  // This example demonstrates all automatic events (like Mixpanel)
15
15
  export default function AutoEventsExample() {
@@ -15,7 +15,7 @@ import {
15
15
  ScrollView,
16
16
  StatusBar,
17
17
  } from 'react-native';
18
- import { datalyr } from '@datalyr/react-native-sdk';
18
+ import { datalyr } from '@datalyr/react-native';
19
19
 
20
20
  const App: React.FC = () => {
21
21
  const [sdkStatus, setSdkStatus] = useState<any>(null);
@@ -152,7 +152,8 @@ export class HttpClient {
152
152
  },
153
153
  context: {
154
154
  library: '@datalyr/react-native',
155
- version: '1.0.2',
155
+ version: '1.0.5',
156
+ source: 'mobile_app', // Explicitly set source for mobile
156
157
  userProperties: payload.userProperties,
157
158
  },
158
159
  timestamp: payload.timestamp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalyr/react-native",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Datalyr SDK for React Native & Expo - Server-side attribution tracking",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -197,7 +197,8 @@ export class HttpClient {
197
197
  },
198
198
  context: {
199
199
  library: '@datalyr/react-native',
200
- version: '1.0.2',
200
+ version: '1.0.5',
201
+ source: 'mobile_app', // Explicitly set source for mobile
201
202
  userProperties: payload.userProperties,
202
203
  },
203
204
  timestamp: payload.timestamp,
@@ -1,234 +0,0 @@
1
- # ๐Ÿ› Debug White Screen Issue
2
-
3
- ## Step 1: Check SDK Version
4
-
5
- First, verify you're using the latest version:
6
-
7
- ```bash
8
- # Check what version is installed
9
- npm list @datalyr/react-native-sdk
10
-
11
- # Update to latest version
12
- npm install @datalyr/react-native-sdk@1.0.10
13
-
14
- # Or with yarn
15
- yarn add @datalyr/react-native-sdk@1.0.10
16
- ```
17
-
18
- ## Step 2: Check Import Pattern
19
-
20
- Make sure you're using the correct import:
21
-
22
- ```typescript
23
- // โœ… CORRECT (v1.0.10+)
24
- import { datalyr } from '@datalyr/react-native-sdk';
25
-
26
- // โŒ WRONG (causes white screen)
27
- import Datalyr from '@datalyr/react-native-sdk';
28
- import DatalyrSDK from '@datalyr/react-native-sdk';
29
- ```
30
-
31
- ## Step 3: Enable Debug Logging
32
-
33
- Add debug logging to see what's happening:
34
-
35
- ```typescript
36
- import { datalyr } from '@datalyr/react-native-sdk';
37
-
38
- const App = () => {
39
- useEffect(() => {
40
- initializeSDK();
41
- }, []);
42
-
43
- const initializeSDK = async () => {
44
- try {
45
- console.log('๐Ÿš€ Starting SDK initialization...');
46
-
47
- await datalyr.initialize({
48
- workspaceId: 'your-workspace-id',
49
- debug: true, // Enable debug logs
50
- autoEvents: {
51
- trackSessions: true,
52
- trackScreenViews: true,
53
- trackAppUpdates: true,
54
- trackPerformance: true,
55
- },
56
- });
57
-
58
- console.log('โœ… SDK initialized successfully');
59
-
60
- } catch (error) {
61
- console.error('โŒ SDK initialization failed:', error);
62
- // Don't let SDK errors crash the app
63
- }
64
- };
65
-
66
- return (
67
- <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
68
- <Text>App is working!</Text>
69
- </View>
70
- );
71
- };
72
- ```
73
-
74
- ## Step 4: Check Metro/React Native Logs
75
-
76
- Run your app and check the logs:
77
-
78
- ```bash
79
- # For React Native CLI
80
- npx react-native run-ios --verbose
81
- # or
82
- npx react-native run-android --verbose
83
-
84
- # For Expo
85
- expo start --clear
86
- ```
87
-
88
- Look for errors like:
89
- - `TypeError: Cannot read property 'initialize' of undefined`
90
- - `ReferenceError: datalyr is not defined`
91
- - Any red error messages
92
-
93
- ## Step 5: Test with Minimal Setup
94
-
95
- Create a minimal test component:
96
-
97
- ```typescript
98
- // TestSDK.tsx
99
- import React, { useEffect, useState } from 'react';
100
- import { View, Text, Alert } from 'react-native';
101
-
102
- // Test 1: Check if import works
103
- try {
104
- const { datalyr } = require('@datalyr/react-native-sdk');
105
- console.log('โœ… Import successful:', typeof datalyr);
106
- } catch (error) {
107
- console.error('โŒ Import failed:', error);
108
- }
109
-
110
- const TestSDK = () => {
111
- const [status, setStatus] = useState('Testing...');
112
-
113
- useEffect(() => {
114
- testSDK();
115
- }, []);
116
-
117
- const testSDK = async () => {
118
- try {
119
- // Test import
120
- const { datalyr } = await import('@datalyr/react-native-sdk');
121
- console.log('โœ… Dynamic import successful');
122
- setStatus('Import OK');
123
-
124
- // Test initialization
125
- await datalyr.initialize({
126
- workspaceId: 'test-workspace',
127
- debug: true,
128
- });
129
-
130
- console.log('โœ… SDK initialized');
131
- setStatus('SDK Initialized');
132
-
133
- } catch (error) {
134
- console.error('โŒ Test failed:', error);
135
- setStatus(`Error: ${error.message}`);
136
- Alert.alert('SDK Test Failed', error.message);
137
- }
138
- };
139
-
140
- return (
141
- <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
142
- <Text>SDK Test Status: {status}</Text>
143
- </View>
144
- );
145
- };
146
-
147
- export default TestSDK;
148
- ```
149
-
150
- ## Step 6: Check Dependencies
151
-
152
- Verify all dependencies are installed:
153
-
154
- ```bash
155
- # Check if these are installed
156
- npm list react-native-get-random-values
157
- npm list @react-native-async-storage/async-storage
158
- npm list uuid
159
-
160
- # Install if missing
161
- npm install react-native-get-random-values @react-native-async-storage/async-storage uuid
162
- ```
163
-
164
- ## Step 7: Platform-Specific Checks
165
-
166
- ### iOS
167
- ```bash
168
- cd ios && pod install && cd ..
169
- npx react-native run-ios --verbose
170
- ```
171
-
172
- ### Android
173
- ```bash
174
- npx react-native run-android --verbose
175
- ```
176
-
177
- ## Step 8: Metro Cache Clear
178
-
179
- Clear Metro cache:
180
-
181
- ```bash
182
- # React Native CLI
183
- npx react-native start --reset-cache
184
-
185
- # Expo
186
- expo start --clear
187
- ```
188
-
189
- ## Step 9: Temporary Workaround
190
-
191
- If still having issues, try this temporary workaround:
192
-
193
- ```typescript
194
- import React, { useEffect } from 'react';
195
- import { View, Text } from 'react-native';
196
-
197
- const App = () => {
198
- useEffect(() => {
199
- // Delay SDK initialization to avoid blocking render
200
- setTimeout(async () => {
201
- try {
202
- const { datalyr } = await import('@datalyr/react-native-sdk');
203
- await datalyr.initialize({
204
- workspaceId: 'your-workspace-id',
205
- debug: true,
206
- });
207
- console.log('โœ… SDK initialized with delay');
208
- } catch (error) {
209
- console.error('โŒ SDK error (non-blocking):', error);
210
- }
211
- }, 1000);
212
- }, []);
213
-
214
- return (
215
- <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
216
- <Text>App is working!</Text>
217
- </View>
218
- );
219
- };
220
-
221
- export default App;
222
- ```
223
-
224
- ## Step 10: Check Package.json
225
-
226
- Verify your package.json has the correct version:
227
-
228
- ```json
229
- {
230
- "dependencies": {
231
- "@datalyr/react-native-sdk": "^1.0.10"
232
- }
233
- }
234
- ```
@@ -1,178 +0,0 @@
1
- # ๐ŸŽฏ React Native CLI vs Expo - SDK Compatibility Guide
2
-
3
- ## ๐Ÿ” Quick Decision Matrix
4
-
5
- **Need maximum attribution accuracy?** โ†’ **React Native CLI**
6
- **Want easier development?** โ†’ **Expo Managed Workflow**
7
- **Want best of both worlds?** โ†’ **Expo Bare Workflow**
8
-
9
- ---
10
-
11
- ## ๐Ÿ“Š Feature Comparison
12
-
13
- | Feature | React Native CLI | Expo Managed | Expo Bare |
14
- |---------|------------------|--------------|-----------|
15
- | **Setup Complexity** | Medium | Easy | Medium |
16
- | **Attribution Accuracy** | 100% | 90% | 100% |
17
- | **IDFA/GAID Collection** | โœ… Full | โš ๏ธ Limited | โœ… Full |
18
- | **Auto Events** | โœ… Full | โœ… Full | โœ… Full |
19
- | **Deep Link Attribution** | โœ… Full | โœ… Full | โœ… Full |
20
- | **Device Fingerprinting** | โœ… Full | โš ๏ธ Limited | โœ… Full |
21
- | **Build/Deploy Ease** | Complex | Easy | Easy |
22
- | **App Store Submission** | Manual | Automated | Automated |
23
- | **OTA Updates** | Custom | โœ… Built-in | โœ… Built-in |
24
-
25
- ---
26
-
27
- ## ๐Ÿš€ React Native CLI (Recommended for Attribution)
28
-
29
- ### โœ… **Pros:**
30
- - **Maximum attribution accuracy** (100%)
31
- - Full IDFA/GAID support for iOS/Android
32
- - Complete device fingerprinting
33
- - Access to all native modules
34
- - Best performance for tracking
35
-
36
- ### โŒ **Cons:**
37
- - More complex setup and configuration
38
- - Manual build and deployment process
39
- - Requires native development knowledge
40
- - No built-in OTA updates
41
-
42
- ### ๐ŸŽฏ **Best For:**
43
- - Apps where attribution accuracy is critical
44
- - Teams comfortable with native development
45
- - Apps that need custom native functionality
46
- - Maximum tracking capabilities
47
-
48
- ### ๐Ÿ“‹ **Installation:**
49
- Follow the main [INSTALL.md](./INSTALL.md) guide.
50
-
51
- ---
52
-
53
- ## ๐ŸŽจ Expo Managed Workflow
54
-
55
- ### โœ… **Pros:**
56
- - **Super easy setup** and development
57
- - Automatic build and deployment (EAS)
58
- - Built-in OTA updates
59
- - No native code complexity
60
- - Great development experience
61
-
62
- ### โŒ **Cons:**
63
- - **Limited IDFA/GAID collection** (needs extra setup)
64
- - Some device info not available
65
- - Can't use custom native modules
66
- - Slightly less attribution accuracy (90%)
67
-
68
- ### ๐ŸŽฏ **Best For:**
69
- - Teams prioritizing development speed
70
- - Apps where core attribution is sufficient
71
- - First-time React Native developers
72
- - Rapid prototyping and MVP development
73
-
74
- ### ๐Ÿ“‹ **Installation:**
75
- Follow the [EXPO_INSTALL.md](./EXPO_INSTALL.md) guide.
76
-
77
- ---
78
-
79
- ## โšก Expo Bare Workflow (Best of Both)
80
-
81
- ### โœ… **Pros:**
82
- - **Full React Native CLI features**
83
- - Easy build/deployment with EAS
84
- - Built-in OTA updates
85
- - Maximum attribution accuracy (100%)
86
- - Can eject to full native if needed
87
-
88
- ### โŒ **Cons:**
89
- - Slightly more complex than managed workflow
90
- - Need to manage native dependencies
91
- - Larger app bundle size
92
-
93
- ### ๐ŸŽฏ **Best For:**
94
- - Teams wanting maximum features + easy deployment
95
- - Apps that might need native modules later
96
- - Best compromise between power and simplicity
97
-
98
- ### ๐Ÿ“‹ **Installation:**
99
- Follow the main [INSTALL.md](./INSTALL.md) guide (same as React Native CLI).
100
-
101
- ---
102
-
103
- ## ๐Ÿ“ฑ Attribution Accuracy Breakdown
104
-
105
- ### **React Native CLI / Expo Bare: 100% Accuracy**
106
- ```typescript
107
- โœ… UTM parameters (utm_source, utm_medium, etc.)
108
- โœ… Click IDs (fbclid, ttclid, gclid)
109
- โœ… LYR tags (lyr, datalyr, dl_tag)
110
- โœ… IDFA collection (iOS with permission)
111
- โœ… GAID collection (Android)
112
- โœ… Full device fingerprinting
113
- โœ… Carrier information
114
- โœ… Precise device specifications
115
- ```
116
-
117
- ### **Expo Managed: 90% Accuracy**
118
- ```typescript
119
- โœ… UTM parameters (utm_source, utm_medium, etc.)
120
- โœ… Click IDs (fbclid, ttclid, gclid)
121
- โœ… LYR tags (lyr, datalyr, dl_tag)
122
- โš ๏ธ IDFA collection (requires expo-ads-admob setup)
123
- โš ๏ธ GAID collection (requires expo-ads-admob setup)
124
- โš ๏ธ Limited device fingerprinting
125
- โŒ Carrier information not available
126
- โš ๏ธ Basic device specifications
127
- ```
128
-
129
- ## ๐ŸŽฏ **Recommendation by Use Case**
130
-
131
- ### **๐Ÿ”ฅ High-Value Apps (E-commerce, Finance, Gaming)**
132
- **โ†’ React Native CLI** or **Expo Bare**
133
- - Need maximum attribution accuracy
134
- - IDFA/GAID collection critical for ROAS optimization
135
- - Can justify development complexity
136
-
137
- ### **๐Ÿ“ฑ Content Apps (News, Social, Productivity)**
138
- **โ†’ Expo Managed Workflow**
139
- - Core attribution (UTM, click IDs) is sufficient
140
- - Development speed more important
141
- - Easy deployment and updates preferred
142
-
143
- ### **๐Ÿš€ Startups/MVPs**
144
- **โ†’ Expo Managed Workflow**
145
- - Ship fast and iterate
146
- - Core attribution covers most needs
147
- - Can migrate to bare/CLI later if needed
148
-
149
- ### **๐Ÿข Enterprise Apps**
150
- **โ†’ React Native CLI** or **Expo Bare**
151
- - Need full control and customization
152
- - Security and compliance requirements
153
- - Custom native integrations likely
154
-
155
- ---
156
-
157
- ## ๐Ÿ’ก **Migration Path**
158
-
159
- **You can always upgrade!**
160
-
161
- ```
162
- Expo Managed โ†’ Expo Bare โ†’ React Native CLI
163
- โ†“ โ†“ โ†“
164
- Easy Medium Complex
165
- 90% 100% 100%
166
- ```
167
-
168
- **Start with Expo Managed if unsure** - you can eject to bare workflow or migrate to React Native CLI when you need more features.
169
-
170
- ---
171
-
172
- ## ๐Ÿš€ **Bottom Line**
173
-
174
- - **Most apps:** Start with **Expo Managed** (90% attribution accuracy is excellent)
175
- - **Attribution-critical apps:** Use **React Native CLI** or **Expo Bare**
176
- - **Want easy deployment:** Use **Expo Bare** (best compromise)
177
-
178
- **All workflows support the automatic events system and core attribution tracking!** ๐ŸŽ‰
@@ -1,206 +0,0 @@
1
- # ๐Ÿ“Š Datalyr Mobile SDK - Completion Status
2
-
3
- ## ๐ŸŽฏ **Is the SDK "Finished"?**
4
-
5
- **Short Answer:** The SDK is **functionally complete** for core attribution tracking but needs **automatic events** to be competitive with Mixpanel.
6
-
7
- **With Auto-Events Added:** The SDK is now **95% complete** and production-ready! ๐Ÿš€
8
-
9
- ---
10
-
11
- ## โœ… **What We Have (Core Attribution SDK)**
12
-
13
- ### **๐Ÿ”ฅ Core Features**
14
- - โœ… **Event Tracking** (`track()`, `screen()`, `identify()`, `alias()`)
15
- - โœ… **Attribution System** (LYR tags, UTM params, fbclid, ttclid, gclid)
16
- - โœ… **Device Fingerprinting** (IDFA/GAID, device info, network detection)
17
- - โœ… **Offline Support** (Queue with retry logic, exponential backoff)
18
- - โœ… **Session Management** (30-min timeout, visitor/session IDs)
19
- - โœ… **Database Integration** (Works with existing Supabase schema)
20
- - โœ… **Deep Link Attribution** (Install tracking, first-launch detection)
21
-
22
- ### **๐ŸŽฏ Attribution Features**
23
- - โœ… **Facebook:** fbclid parameter capture
24
- - โœ… **TikTok:** ttclid parameter capture
25
- - โœ… **Google:** gclid parameter capture
26
- - โœ… **UTM Parameters:** Full support (source, medium, campaign, etc.)
27
- - โœ… **LYR Tags:** Custom attribution system (lyr, datalyr, dl_tag)
28
- - โœ… **Install Detection:** First launch attribution
29
- - โœ… **Deep Links:** URL parameter extraction
30
-
31
- ### **๐Ÿ“ฑ Technical Architecture**
32
- - โœ… **TypeScript:** Full type safety
33
- - โœ… **React Native:** Cross-platform (iOS/Android)
34
- - โœ… **Modular Design:** Pluggable components
35
- - โœ… **Error Handling:** Comprehensive try/catch with logging
36
- - โœ… **Performance:** Lightweight, non-blocking
37
- - โœ… **Privacy:** GDPR/CCPA compliant (respectDoNotTrack)
38
-
39
- ---
40
-
41
- ## ๐Ÿš€ **What We Added (Auto-Events System)**
42
-
43
- ### **๐Ÿ“Š Automatic Events (Like Mixpanel)**
44
- - โœ… **Session Tracking** (`session_start`, `session_end`)
45
- - โœ… **App Lifecycle** (`app_foreground`, `app_background`)
46
- - โœ… **Screen Views** (Automatic `pageviews` events)
47
- - โœ… **App Install** (First launch detection)
48
- - โœ… **App Updates** (Version change detection)
49
- - โœ… **Performance** (`app_launch_performance`)
50
- - โœ… **Revenue Events** (Automatic purchase tracking)
51
- - โœ… **SDK Events** (`sdk_initialized`)
52
-
53
- ### **๐ŸŽ›๏ธ Auto-Events Configuration**
54
- ```typescript
55
- autoEvents: {
56
- trackSessions: true, // Session start/end
57
- trackScreenViews: true, // Automatic screen tracking
58
- trackAppUpdates: true, // App version changes
59
- trackPerformance: true, // Launch time tracking
60
- sessionTimeoutMs: 30 * 60 * 1000, // 30 minutes
61
- }
62
- ```
63
-
64
- ### **๐Ÿ“Š Mixpanel Parity**
65
- | Feature | Mixpanel | Datalyr SDK | Status |
66
- |---------|----------|-------------|---------|
67
- | Session Tracking | โœ… | โœ… | **Complete** |
68
- | Screen Views | โœ… | โœ… | **Complete** |
69
- | App Install | โœ… | โœ… | **Complete** |
70
- | App Updates | โœ… | โœ… | **Complete** |
71
- | App Lifecycle | โœ… | โœ… | **Complete** |
72
- | Performance | โœ… | โœ… | **Complete** |
73
- | Revenue Tracking | โœ… | โœ… | **Complete** |
74
- | Push Notifications | โœ… | โŒ | *Optional* |
75
- | Crash Tracking | โœ… | โŒ | *Optional* |
76
- | A/B Testing | โœ… | โŒ | *Not needed* |
77
-
78
- ---
79
-
80
- ## ๐Ÿ“ˆ **SDK Usage Example**
81
-
82
- ```typescript
83
- import { datalyr } from '@datalyr/react-native-sdk';
84
-
85
- // Initialize with auto-events
86
- await datalyr.initialize({
87
- workspaceId: 'your-workspace-id',
88
- autoEvents: {
89
- trackSessions: true,
90
- trackScreenViews: true,
91
- trackAppUpdates: true,
92
- trackPerformance: true,
93
- },
94
- });
95
-
96
- // Manual events still work
97
- await datalyr.track('purchase', {
98
- value: 29.99,
99
- currency: 'USD'
100
- });
101
-
102
- // Automatic events happen behind the scenes:
103
- // โœ… session_start (automatic)
104
- // โœ… app_install (automatic)
105
- // โœ… pageviews (automatic)
106
- // โœ… app_foreground (automatic)
107
- // โœ… session_end (automatic)
108
- ```
109
-
110
- ---
111
-
112
- ## ๐Ÿ†š **Comparison: Manual vs. Automatic Events**
113
-
114
- ### **Before Auto-Events (Manual Only)**
115
- ```typescript
116
- // Developer had to track everything manually
117
- await datalyr.track('session_start', { timestamp: Date.now() });
118
- await datalyr.screen('Home');
119
- await datalyr.track('app_foreground', { /* manual data */ });
120
- // ๐Ÿ˜ฐ Easy to forget, inconsistent data
121
- ```
122
-
123
- ### **After Auto-Events (Like Mixpanel)**
124
- ```typescript
125
- // SDK tracks automatically
126
- // โœ… session_start (automatic)
127
- // โœ… pageviews: Home (automatic)
128
- // โœ… app_foreground (automatic)
129
- // ๐Ÿ˜Ž Consistent, complete data out-of-the-box
130
- ```
131
-
132
- ---
133
-
134
- ## ๐ŸŽฏ **Is It Production Ready?**
135
-
136
- ### **โœ… YES for Attribution**
137
- - Complete attribution tracking
138
- - All major ad platforms supported
139
- - Deep link and install attribution
140
- - Works with existing backend
141
-
142
- ### **โœ… YES for Analytics (Now)**
143
- - Automatic events like Mixpanel
144
- - Session and user journey tracking
145
- - Revenue and conversion tracking
146
- - Performance monitoring
147
-
148
- ### **๐Ÿ”ฅ Competitive Analysis**
149
-
150
- | SDK Feature | Mixpanel | Amplitude | Firebase | **Datalyr** |
151
- |-------------|----------|-----------|----------|-------------|
152
- | Attribution | โŒ | โŒ | โŒ | **โœ…** |
153
- | Auto Events | โœ… | โœ… | โœ… | **โœ…** |
154
- | Session Tracking | โœ… | โœ… | โœ… | **โœ…** |
155
- | Offline Support | โœ… | โœ… | โœ… | **โœ…** |
156
- | Ad Platform Integration | โŒ | โŒ | โŒ | **โœ…** |
157
- | Revenue Tracking | โœ… | โœ… | โœ… | **โœ…** |
158
-
159
- **๐Ÿ† Datalyr Advantage:** Only SDK that combines attribution + automatic events!
160
-
161
- ---
162
-
163
- ## ๐Ÿšง **What's Still Missing (Optional)**
164
-
165
- ### **๐Ÿ“ฑ Advanced Features (10% of value)**
166
- - โŒ **Push Notification Attribution** (clicks, opens)
167
- - โŒ **Crash Reporting** (app crashes, errors)
168
- - โŒ **Network State Monitoring** (online/offline events)
169
- - โŒ **Advanced Fingerprinting** (canvas, audio fingerprinting)
170
- - โŒ **A/B Testing** (not needed for attribution)
171
-
172
- ### **๐Ÿ”ง Development Improvements**
173
- - โŒ **Native iOS SDK** (Swift implementation)
174
- - โŒ **Native Android SDK** (Kotlin implementation)
175
- - โŒ **React Native Navigation** (Auto screen tracking)
176
- - โŒ **Expo Plugin** (Easy configuration)
177
-
178
- ---
179
-
180
- ## ๐ŸŽ‰ **Final Verdict**
181
-
182
- ### **SDK Completion: 95% โœ…**
183
-
184
- **Core Attribution:** 100% Complete โœ…
185
- **Automatic Events:** 100% Complete โœ…
186
- **Advanced Features:** 60% Complete (optional)
187
-
188
- **Latest Version:** v1.0.10 - Production Ready ๐Ÿš€
189
-
190
- ### **Ready for Production?**
191
-
192
- **๐Ÿ”ฅ ABSOLUTELY YES!**
193
-
194
- The SDK now provides:
195
- 1. **Complete attribution tracking** (better than any competitor)
196
- 2. **Automatic events** (like Mixpanel/Amplitude)
197
- 3. **Production-grade reliability** (offline support, error handling)
198
- 4. **Easy integration** (works with existing backend)
199
-
200
- ### **Next Steps**
201
- 1. โœ… **Test in your mobile app**
202
- 2. โœ… **Verify attribution flow**
203
- 3. โœ… **Monitor automatic events**
204
- 4. ๐Ÿš€ **Launch to production**
205
-
206
- The mobile SDK is now **feature-complete** and ready for real-world usage! ๐Ÿš€