@dashx/react-native 1.5.0 → 1.5.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 (85) hide show
  1. package/README.md +1 -1
  2. package/ios/DashXReactNative.mm +7 -7
  3. package/ios/DashXReactNative.swift +15 -11
  4. package/package.json +13 -11
  5. package/.claude/settings.local.json +0 -7
  6. package/.claude/worktrees/autocapture-conventions-review-78f665/.gitattributes +0 -1
  7. package/.claude/worktrees/autocapture-conventions-review-78f665/.github/workflows/ci.yml +0 -67
  8. package/.claude/worktrees/autocapture-conventions-review-78f665/.gitignore +0 -49
  9. package/.claude/worktrees/autocapture-conventions-review-78f665/.nvmrc +0 -1
  10. package/.claude/worktrees/autocapture-conventions-review-78f665/CHANGELOG.md +0 -144
  11. package/.claude/worktrees/autocapture-conventions-review-78f665/CONTRIBUTING.md +0 -190
  12. package/.claude/worktrees/autocapture-conventions-review-78f665/DashXReactNative.podspec +0 -38
  13. package/.claude/worktrees/autocapture-conventions-review-78f665/LICENSE +0 -21
  14. package/.claude/worktrees/autocapture-conventions-review-78f665/README.md +0 -97
  15. package/.claude/worktrees/autocapture-conventions-review-78f665/__tests__/fallback.test.js +0 -72
  16. package/.claude/worktrees/autocapture-conventions-review-78f665/__tests__/index.test.js +0 -702
  17. package/.claude/worktrees/autocapture-conventions-review-78f665/android/.gitignore +0 -10
  18. package/.claude/worktrees/autocapture-conventions-review-78f665/android/.gradle/8.14.3/checksums/checksums.lock +0 -0
  19. package/.claude/worktrees/autocapture-conventions-review-78f665/android/.gradle/8.14.3/fileChanges/last-build.bin +0 -0
  20. package/.claude/worktrees/autocapture-conventions-review-78f665/android/.gradle/8.14.3/fileHashes/fileHashes.lock +0 -0
  21. package/.claude/worktrees/autocapture-conventions-review-78f665/android/.gradle/8.14.3/gc.properties +0 -0
  22. package/.claude/worktrees/autocapture-conventions-review-78f665/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  23. package/.claude/worktrees/autocapture-conventions-review-78f665/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  24. package/.claude/worktrees/autocapture-conventions-review-78f665/android/.gradle/vcs-1/gc.properties +0 -0
  25. package/.claude/worktrees/autocapture-conventions-review-78f665/android/build/reports/problems/problems-report.html +0 -663
  26. package/.claude/worktrees/autocapture-conventions-review-78f665/android/build.gradle +0 -121
  27. package/.claude/worktrees/autocapture-conventions-review-78f665/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  28. package/.claude/worktrees/autocapture-conventions-review-78f665/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  29. package/.claude/worktrees/autocapture-conventions-review-78f665/android/gradle.properties +0 -1
  30. package/.claude/worktrees/autocapture-conventions-review-78f665/android/gradlew +0 -185
  31. package/.claude/worktrees/autocapture-conventions-review-78f665/android/gradlew.bat +0 -89
  32. package/.claude/worktrees/autocapture-conventions-review-78f665/android/settings.gradle +0 -27
  33. package/.claude/worktrees/autocapture-conventions-review-78f665/android/src/main/AndroidManifest.xml +0 -19
  34. package/.claude/worktrees/autocapture-conventions-review-78f665/android/src/main/java/com/dashx/rn/sdk/DashXNotificationClickedListener.kt +0 -113
  35. package/.claude/worktrees/autocapture-conventions-review-78f665/android/src/main/java/com/dashx/rn/sdk/DashXReactNativeFirebaseMessagingService.kt +0 -72
  36. package/.claude/worktrees/autocapture-conventions-review-78f665/android/src/main/java/com/dashx/rn/sdk/DashXReactNativeModuleImpl.kt +0 -445
  37. package/.claude/worktrees/autocapture-conventions-review-78f665/android/src/main/java/com/dashx/rn/sdk/MessageReceivedEventHolder.kt +0 -14
  38. package/.claude/worktrees/autocapture-conventions-review-78f665/android/src/main/java/com/dashx/rn/sdk/ReactNativeLibraryInfoProvider.kt +0 -8
  39. package/.claude/worktrees/autocapture-conventions-review-78f665/android/src/main/java/com/dashx/rn/sdk/util/Utils.kt +0 -208
  40. package/.claude/worktrees/autocapture-conventions-review-78f665/android/src/main/resources/META-INF/services/com.dashx.android.DashXLibraryInfoProvider +0 -1
  41. package/.claude/worktrees/autocapture-conventions-review-78f665/android/src/newarch/java/com/dashx/rn/sdk/DashXReactNativeModule.kt +0 -85
  42. package/.claude/worktrees/autocapture-conventions-review-78f665/android/src/newarch/java/com/dashx/rn/sdk/DashXReactNativePackage.kt +0 -33
  43. package/.claude/worktrees/autocapture-conventions-review-78f665/android/src/oldarch/java/com/dashx/rn/sdk/DashXReactNativeModule.kt +0 -106
  44. package/.claude/worktrees/autocapture-conventions-review-78f665/android/src/oldarch/java/com/dashx/rn/sdk/DashXReactNativePackage.kt +0 -33
  45. package/.claude/worktrees/autocapture-conventions-review-78f665/android/src/test/java/com/dashx/rn/sdk/util/UtilsTest.kt +0 -305
  46. package/.claude/worktrees/autocapture-conventions-review-78f665/babel.config.js +0 -3
  47. package/.claude/worktrees/autocapture-conventions-review-78f665/index.d.ts +0 -321
  48. package/.claude/worktrees/autocapture-conventions-review-78f665/index.js +0 -300
  49. package/.claude/worktrees/autocapture-conventions-review-78f665/ios/DashXEventEmitter.swift +0 -15
  50. package/.claude/worktrees/autocapture-conventions-review-78f665/ios/DashXNotificationHandler.swift +0 -301
  51. package/.claude/worktrees/autocapture-conventions-review-78f665/ios/DashXReactNative-Bridging-Header.h +0 -3
  52. package/.claude/worktrees/autocapture-conventions-review-78f665/ios/DashXReactNative.mm +0 -77
  53. package/.claude/worktrees/autocapture-conventions-review-78f665/ios/DashXReactNative.swift +0 -244
  54. package/.claude/worktrees/autocapture-conventions-review-78f665/ios/DashXReactNative.xcodeproj/project.pbxproj +0 -280
  55. package/.claude/worktrees/autocapture-conventions-review-78f665/ios/DashXReactNative.xcworkspace/contents.xcworkspacedata +0 -7
  56. package/.claude/worktrees/autocapture-conventions-review-78f665/ios/DashXReactNative.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  57. package/.claude/worktrees/autocapture-conventions-review-78f665/package.json +0 -123
  58. package/.claude/worktrees/autocapture-conventions-review-78f665/scripts/generate-bridge-shim.js +0 -259
  59. package/.claude/worktrees/autocapture-conventions-review-78f665/src/NativeDashXReactNative.ts +0 -42
  60. package/.claude/worktrees/autocapture-conventions-review-78f665/yarn.lock +0 -6244
  61. package/.gitattributes +0 -1
  62. package/.github/workflows/ci.yml +0 -67
  63. package/.gitignore +0 -49
  64. package/.nvmrc +0 -1
  65. package/CHANGELOG.md +0 -144
  66. package/CONTRIBUTING.md +0 -190
  67. package/__tests__/fallback.test.js +0 -72
  68. package/__tests__/index.test.js +0 -702
  69. package/android/.gitignore +0 -10
  70. package/android/.gradle/8.14.3/checksums/checksums.lock +0 -0
  71. package/android/.gradle/8.14.3/fileChanges/last-build.bin +0 -0
  72. package/android/.gradle/8.14.3/fileHashes/fileHashes.lock +0 -0
  73. package/android/.gradle/8.14.3/gc.properties +0 -0
  74. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  75. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  76. package/android/.gradle/vcs-1/gc.properties +0 -0
  77. package/android/build/reports/problems/problems-report.html +0 -663
  78. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  79. package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  80. package/android/gradlew +0 -185
  81. package/android/gradlew.bat +0 -89
  82. package/android/src/test/java/com/dashx/rn/sdk/util/UtilsTest.kt +0 -305
  83. package/babel.config.js +0 -3
  84. package/scripts/generate-bridge-shim.js +0 -259
  85. package/yarn.lock +0 -6244
@@ -1,38 +0,0 @@
1
- require "json"
2
-
3
- package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
-
5
- Pod::Spec.new do |s|
6
- s.name = "DashXReactNative"
7
- s.version = package["version"]
8
- s.summary = package["description"]
9
- s.homepage = package["homepage"]
10
- s.license = package["license"]
11
- s.authors = package["author"]
12
-
13
- s.platforms = { :ios => "13.0" }
14
- s.source = { :git => "https://github.com/dashxhq/dashx-react-native.git", :tag => "#{s.version}" }
15
-
16
- s.source_files = "ios/**/*.{h,m,mm,swift}"
17
- s.requires_arc = true
18
-
19
- # React Native >= 0.71 provides install_modules_dependencies.
20
- # Since our minimum supported RN version is 0.74, we can call it directly.
21
- install_modules_dependencies(s)
22
-
23
- # DashX iOS SDK — consumers must provide the source in their Podfile:
24
- # pod 'DashX/SDK', :git => 'https://github.com/dashxhq/dashx-ios.git', :tag => '1.6.1'
25
- # For local development:
26
- # pod 'DashX', :path => '../dashx-ios'
27
- #
28
- # Floor of 1.6.1, the first release whose automatic event names match
29
- # dashx-android 1.5.0 ($screen, Deep Link Opened, Push Notification Tapped).
30
- s.dependency "DashX/SDK", ">= 1.6.1"
31
-
32
- # Hard dependency so that `canImport(FirebaseMessaging)`
33
- # evaluates at this pod's compile time, where consumer-Podfile pods aren't
34
- # visible — so an "optional" guard silently elides every Firebase code path.
35
- # Consumers should set `use_modular_headers!` (or `:modular_headers => true`
36
- # on FirebaseMessaging) in their Podfile so this Swift import resolves.
37
- s.dependency "FirebaseMessaging"
38
- end
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 DashX
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,97 +0,0 @@
1
- <p align="center">
2
- <br />
3
- <a href="https://dashx.com"><img src="https://raw.githubusercontent.com/dashxhq/brand-book/master/assets/logo-black-text-color-icon@2x.png" alt="DashX" height="40" /></a>
4
- <br />
5
- <br />
6
- <strong>Your All-in-One Product Stack</strong>
7
- </p>
8
-
9
- <div align="center">
10
- <h4>
11
- <a href="https://dashx.com">Website</a>
12
- <span> | </span>
13
- <a href="https://docs.dashx.com">Documentation</a>
14
- </h4>
15
- </div>
16
-
17
- <br />
18
-
19
- # @dashx/react-native
20
-
21
- [![npm version](https://img.shields.io/npm/v/@dashx/react-native.svg)](https://www.npmjs.com/package/@dashx/react-native)
22
- [![license](https://img.shields.io/npm/l/@dashx/react-native.svg)](https://github.com/dashxhq/dashx-react-native/blob/main/LICENSE)
23
- [![platforms](https://img.shields.io/badge/platforms-Android%20%7C%20iOS-brightgreen.svg)](#install)
24
-
25
- _DashX SDK for React Native_
26
-
27
- ## Install
28
-
29
- Requires **React Native 0.74+**, **iOS 13.0+**, **Android SDK 26+**, and **Node.js 16+**.
30
-
31
- Supports both the **Old Architecture** (bridge) and **New Architecture** (TurboModule) from a single install.
32
-
33
- > **Note:** This SDK uses native modules and is **not compatible with Expo Go**. Use a [development build](https://docs.expo.dev/develop/development-builds/introduction/) if you are using Expo.
34
-
35
- ```sh
36
- npm install @dashx/react-native
37
- ```
38
-
39
- or
40
-
41
- ```sh
42
- yarn add @dashx/react-native
43
- ```
44
-
45
- ## Documentation
46
-
47
- For detailed documentation, visit [React Native SDK documentation](https://docs.dashx.com/sdks/client-side/react-native-sdk).
48
-
49
- ## Automatic events
50
-
51
- ### App lifecycle
52
-
53
- On iOS and Android, call `enableLifecycleTracking()` after `configure` to send these events:
54
-
55
- - `Application Installed` and `Application Updated` on the first launch of a new install or build
56
- - `Application Opened` on launch and when returning to the foreground (`from_background`)
57
- - `Application Backgrounded` when the app leaves the foreground (`session_length`, in seconds)
58
- - `Application Crashed` on an uncaught native exception (iOS only)
59
-
60
- ```js
61
- DashX.configure({ publicKey: 'YOUR_PUBLIC_KEY' });
62
- DashX.enableLifecycleTracking();
63
- ```
64
-
65
- ### Screen views with React Navigation
66
-
67
- React Native screens are routes rather than native screens, so track them from the navigation container. `trackNavigation` sends `DashX.screen(route.name)`, recorded as `$screen` with the route name in `$screen_name`, for the first route and then whenever the focused route's name changes. Route params are not sent. Call it from `onReady` so the first screen is captured; it returns a function that stops tracking.
68
-
69
- ```jsx
70
- import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native';
71
- import DashX from '@dashx/react-native';
72
-
73
- export default function App() {
74
- const navigationRef = useNavigationContainerRef();
75
-
76
- return (
77
- <NavigationContainer
78
- ref={navigationRef}
79
- onReady={() => DashX.trackNavigation(navigationRef)}
80
- >
81
- {/* ... */}
82
- </NavigationContainer>
83
- );
84
- }
85
- ```
86
-
87
- ## Deep linking and push navigation
88
-
89
- See the [Deep Linking & Push Navigation](https://docs.dashx.com/apps/messaging/deep-linking) guide for setup instructions, payload fields, and code examples.
90
-
91
- ## Contributing
92
-
93
- See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and workflow.
94
-
95
- ## License
96
-
97
- MIT
@@ -1,72 +0,0 @@
1
- const mockNativeModule = {
2
- configure: jest.fn(),
3
- identify: jest.fn(),
4
- setIdentity: jest.fn(),
5
- reset: jest.fn(),
6
- track: jest.fn(),
7
- screen: jest.fn(),
8
- fetchRecord: jest.fn(),
9
- searchRecords: jest.fn(),
10
- fetchStoredPreferences: jest.fn(),
11
- saveStoredPreferences: jest.fn(),
12
- subscribe: jest.fn(),
13
- unsubscribe: jest.fn(),
14
- setLogLevel: jest.fn(),
15
- uploadAsset: jest.fn(),
16
- fetchAsset: jest.fn(),
17
- enableLifecycleTracking: jest.fn(),
18
- enableAdTracking: jest.fn(),
19
- processURL: jest.fn(),
20
- trackNotificationNavigation: jest.fn(),
21
- requestNotificationPermission: jest.fn(),
22
- getNotificationPermissionStatus: jest.fn(),
23
- addListener: jest.fn(),
24
- removeListeners: jest.fn(),
25
- };
26
-
27
- jest.mock('react-native', () => ({
28
- NativeModules: {
29
- DashXReactNative: mockNativeModule,
30
- },
31
- NativeEventEmitter: jest.fn().mockImplementation(() => ({
32
- addListener: jest.fn(() => ({ remove: jest.fn() })),
33
- })),
34
- Platform: {
35
- OS: 'ios',
36
- select: jest.fn((obj) => obj.default || ''),
37
- },
38
- TurboModuleRegistry: {
39
- get: jest.fn(() => null),
40
- getEnforcing: jest.fn(() => {
41
- throw new Error('not available');
42
- }),
43
- },
44
- }));
45
-
46
- // TurboModule returns null -> should fall back to NativeModules
47
- jest.mock('../src/NativeDashXReactNative', () => ({
48
- __esModule: true,
49
- default: null,
50
- }));
51
-
52
- const DashX = require('../index').default;
53
-
54
- describe('NativeModules fallback', () => {
55
- beforeEach(() => {
56
- jest.clearAllMocks();
57
- });
58
-
59
- it('falls back to NativeModules.DashXReactNative when TurboModule is null', () => {
60
- DashX.configure({ publicKey: 'pk_test' });
61
- expect(mockNativeModule.configure).toHaveBeenCalledWith({
62
- publicKey: 'pk_test',
63
- });
64
- });
65
-
66
- it('calls track on the fallback module', () => {
67
- DashX.track('event_name', { key: 'value' });
68
- expect(mockNativeModule.track).toHaveBeenCalledWith('event_name', {
69
- key: 'value',
70
- });
71
- });
72
- });