@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,121 +0,0 @@
1
- import groovy.json.JsonSlurper
2
-
3
- // Standalone build path (used by CI via `./gradlew :testDebugUnitTest` from
4
- // this `android/` directory). When consumer apps autolink the bridge, this
5
- // buildscript block is evaluated as a subproject too but is a no-op since
6
- // the consumer's root already provides identical or newer classpath
7
- // entries — AGP/Kotlin plugin classes are loaded once and shared.
8
- buildscript {
9
- repositories {
10
- google()
11
- mavenCentral()
12
- gradlePluginPortal()
13
- }
14
- dependencies {
15
- classpath 'com.android.tools.build:gradle:8.7.2'
16
- classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.0'
17
- }
18
- }
19
-
20
- apply plugin: 'com.android.library'
21
- apply plugin: 'kotlin-android'
22
-
23
- def isNewArchitectureEnabled() {
24
- return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
25
- }
26
-
27
- if (isNewArchitectureEnabled()) {
28
- apply plugin: 'com.facebook.react'
29
- }
30
-
31
- def getVersionFromNpm() {
32
- def inputFile = new File("../package.json")
33
- def packageJson = new JsonSlurper().parseText(inputFile.text)
34
-
35
- return packageJson["version"]
36
- }
37
-
38
- android {
39
- namespace 'com.dashx.rn.sdk'
40
- compileSdkVersion 34
41
-
42
- buildFeatures {
43
- buildConfig = true
44
- }
45
-
46
- defaultConfig {
47
- minSdkVersion 26
48
- targetSdkVersion 34
49
- versionCode 1
50
- versionName getVersionFromNpm()
51
-
52
- buildConfigField 'String', 'VERSION_NAME', "\"$versionName\""
53
- }
54
- // Align Java + Kotlin target so the standalone CI build (which doesn't
55
- // inherit RN's defaults) doesn't trip "Inconsistent JVM-target
56
- // compatibility". Consumers autolinking the bridge already set these
57
- // at root scope; redeclaring here is a no-op when versions match.
58
- compileOptions {
59
- sourceCompatibility = JavaVersion.VERSION_17
60
- targetCompatibility = JavaVersion.VERSION_17
61
- }
62
- kotlinOptions {
63
- jvmTarget = '17'
64
- }
65
- lint {
66
- abortOnError false
67
- }
68
-
69
- sourceSets {
70
- main {
71
- if (isNewArchitectureEnabled()) {
72
- java.srcDirs += ['src/newarch/java']
73
- } else {
74
- java.srcDirs += ['src/oldarch/java']
75
- }
76
- }
77
- }
78
-
79
- packaging {
80
- pickFirst 'lib/arm64-v8a/libc++_shared.so'
81
- pickFirst 'lib/arm64-v8a/libfbjni.so'
82
- pickFirst 'lib/armeabi-v7a/libc++_shared.so'
83
- pickFirst 'lib/armeabi-v7a/libfbjni.so'
84
- pickFirst 'lib/x86/libc++_shared.so'
85
- pickFirst 'lib/x86/libfbjni.so'
86
- pickFirst 'lib/x86_64/libc++_shared.so'
87
- pickFirst 'lib/x86_64/libfbjni.so'
88
- }
89
- }
90
-
91
- if (isNewArchitectureEnabled()) {
92
- react {
93
- jsRootDir = file("../src/")
94
- libraryName = "RNDashXReactNativeSpec"
95
- codegenJavaPackageName = "com.dashx.rn.sdk"
96
- }
97
- }
98
-
99
- repositories {
100
- mavenCentral()
101
- google()
102
- }
103
-
104
- dependencies {
105
- compileOnly 'com.facebook.react:react-android:+'
106
-
107
- implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0'
108
-
109
- // Ensure Firebase Messaging types are available for FCM service subclass
110
- implementation 'com.google.firebase:firebase-messaging-ktx:23.1.2'
111
-
112
- implementation "com.dashx:dashx-android:1.5.0"
113
-
114
- // Unit tests for `util/Utils.kt` — JVM-only, no Robolectric. The RN
115
- // `react-android` artifact is pulled in at test runtime (not as a
116
- // runtime dep) so tests can reach `JavaOnlyMap` / `JavaOnlyArray` —
117
- // pure-Java `ReadableMap` / `WritableMap` impls that stand in for the
118
- // JNI-backed `WritableNativeMap` / `WritableNativeArray` in JVM tests.
119
- testImplementation 'junit:junit:4.13.2'
120
- testImplementation 'com.facebook.react:react-android:+'
121
- }
@@ -1,6 +0,0 @@
1
- #Mon Oct 30 16:24:27 IST 2023
2
- distributionBase=GRADLE_USER_HOME
3
- distributionPath=wrapper/dists
4
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
5
- zipStoreBase=GRADLE_USER_HOME
6
- zipStorePath=wrapper/dists
@@ -1,185 +0,0 @@
1
- #!/usr/bin/env sh
2
-
3
- #
4
- # Copyright 2015 the original author or authors.
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # https://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- ##############################################################################
20
- ##
21
- ## Gradle start up script for UN*X
22
- ##
23
- ##############################################################################
24
-
25
- # Attempt to set APP_HOME
26
- # Resolve links: $0 may be a link
27
- PRG="$0"
28
- # Need this for relative symlinks.
29
- while [ -h "$PRG" ] ; do
30
- ls=`ls -ld "$PRG"`
31
- link=`expr "$ls" : '.*-> \(.*\)$'`
32
- if expr "$link" : '/.*' > /dev/null; then
33
- PRG="$link"
34
- else
35
- PRG=`dirname "$PRG"`"/$link"
36
- fi
37
- done
38
- SAVED="`pwd`"
39
- cd "`dirname \"$PRG\"`/" >/dev/null
40
- APP_HOME="`pwd -P`"
41
- cd "$SAVED" >/dev/null
42
-
43
- APP_NAME="Gradle"
44
- APP_BASE_NAME=`basename "$0"`
45
-
46
- # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47
- DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48
-
49
- # Use the maximum available, or set MAX_FD != -1 to use that value.
50
- MAX_FD="maximum"
51
-
52
- warn () {
53
- echo "$*"
54
- }
55
-
56
- die () {
57
- echo
58
- echo "$*"
59
- echo
60
- exit 1
61
- }
62
-
63
- # OS specific support (must be 'true' or 'false').
64
- cygwin=false
65
- msys=false
66
- darwin=false
67
- nonstop=false
68
- case "`uname`" in
69
- CYGWIN* )
70
- cygwin=true
71
- ;;
72
- Darwin* )
73
- darwin=true
74
- ;;
75
- MSYS* | MINGW* )
76
- msys=true
77
- ;;
78
- NONSTOP* )
79
- nonstop=true
80
- ;;
81
- esac
82
-
83
- CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84
-
85
-
86
- # Determine the Java command to use to start the JVM.
87
- if [ -n "$JAVA_HOME" ] ; then
88
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89
- # IBM's JDK on AIX uses strange locations for the executables
90
- JAVACMD="$JAVA_HOME/jre/sh/java"
91
- else
92
- JAVACMD="$JAVA_HOME/bin/java"
93
- fi
94
- if [ ! -x "$JAVACMD" ] ; then
95
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96
-
97
- Please set the JAVA_HOME variable in your environment to match the
98
- location of your Java installation."
99
- fi
100
- else
101
- JAVACMD="java"
102
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103
-
104
- Please set the JAVA_HOME variable in your environment to match the
105
- location of your Java installation."
106
- fi
107
-
108
- # Increase the maximum file descriptors if we can.
109
- if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110
- MAX_FD_LIMIT=`ulimit -H -n`
111
- if [ $? -eq 0 ] ; then
112
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113
- MAX_FD="$MAX_FD_LIMIT"
114
- fi
115
- ulimit -n $MAX_FD
116
- if [ $? -ne 0 ] ; then
117
- warn "Could not set maximum file descriptor limit: $MAX_FD"
118
- fi
119
- else
120
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121
- fi
122
- fi
123
-
124
- # For Darwin, add options to specify how the application appears in the dock
125
- if $darwin; then
126
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127
- fi
128
-
129
- # For Cygwin or MSYS, switch paths to Windows format before running java
130
- if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133
-
134
- JAVACMD=`cygpath --unix "$JAVACMD"`
135
-
136
- # We build the pattern for arguments to be converted via cygpath
137
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138
- SEP=""
139
- for dir in $ROOTDIRSRAW ; do
140
- ROOTDIRS="$ROOTDIRS$SEP$dir"
141
- SEP="|"
142
- done
143
- OURCYGPATTERN="(^($ROOTDIRS))"
144
- # Add a user-defined pattern to the cygpath arguments
145
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147
- fi
148
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
149
- i=0
150
- for arg in "$@" ; do
151
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153
-
154
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156
- else
157
- eval `echo args$i`="\"$arg\""
158
- fi
159
- i=`expr $i + 1`
160
- done
161
- case $i in
162
- 0) set -- ;;
163
- 1) set -- "$args0" ;;
164
- 2) set -- "$args0" "$args1" ;;
165
- 3) set -- "$args0" "$args1" "$args2" ;;
166
- 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167
- 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168
- 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169
- 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170
- 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171
- 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172
- esac
173
- fi
174
-
175
- # Escape application args
176
- save () {
177
- for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178
- echo " "
179
- }
180
- APP_ARGS=`save "$@"`
181
-
182
- # Collect all arguments for the java command, following the shell quoting and substitution rules
183
- eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184
-
185
- exec "$JAVACMD" "$@"
@@ -1,89 +0,0 @@
1
- @rem
2
- @rem Copyright 2015 the original author or authors.
3
- @rem
4
- @rem Licensed under the Apache License, Version 2.0 (the "License");
5
- @rem you may not use this file except in compliance with the License.
6
- @rem You may obtain a copy of the License at
7
- @rem
8
- @rem https://www.apache.org/licenses/LICENSE-2.0
9
- @rem
10
- @rem Unless required by applicable law or agreed to in writing, software
11
- @rem distributed under the License is distributed on an "AS IS" BASIS,
12
- @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- @rem See the License for the specific language governing permissions and
14
- @rem limitations under the License.
15
- @rem
16
-
17
- @if "%DEBUG%" == "" @echo off
18
- @rem ##########################################################################
19
- @rem
20
- @rem Gradle startup script for Windows
21
- @rem
22
- @rem ##########################################################################
23
-
24
- @rem Set local scope for the variables with windows NT shell
25
- if "%OS%"=="Windows_NT" setlocal
26
-
27
- set DIRNAME=%~dp0
28
- if "%DIRNAME%" == "" set DIRNAME=.
29
- set APP_BASE_NAME=%~n0
30
- set APP_HOME=%DIRNAME%
31
-
32
- @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33
- for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34
-
35
- @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36
- set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37
-
38
- @rem Find java.exe
39
- if defined JAVA_HOME goto findJavaFromJavaHome
40
-
41
- set JAVA_EXE=java.exe
42
- %JAVA_EXE% -version >NUL 2>&1
43
- if "%ERRORLEVEL%" == "0" goto execute
44
-
45
- echo.
46
- echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47
- echo.
48
- echo Please set the JAVA_HOME variable in your environment to match the
49
- echo location of your Java installation.
50
-
51
- goto fail
52
-
53
- :findJavaFromJavaHome
54
- set JAVA_HOME=%JAVA_HOME:"=%
55
- set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56
-
57
- if exist "%JAVA_EXE%" goto execute
58
-
59
- echo.
60
- echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61
- echo.
62
- echo Please set the JAVA_HOME variable in your environment to match the
63
- echo location of your Java installation.
64
-
65
- goto fail
66
-
67
- :execute
68
- @rem Setup the command line
69
-
70
- set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71
-
72
-
73
- @rem Execute Gradle
74
- "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75
-
76
- :end
77
- @rem End local scope for the variables with windows NT shell
78
- if "%ERRORLEVEL%"=="0" goto mainEnd
79
-
80
- :fail
81
- rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82
- rem the _cmd.exe /c_ return code!
83
- if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84
- exit /b 1
85
-
86
- :mainEnd
87
- if "%OS%"=="Windows_NT" endlocal
88
-
89
- :omega
@@ -1,27 +0,0 @@
1
- // Minimal standalone Gradle config so CI can run the bridge's unit tests
2
- // (`./gradlew :testDebugUnitTest`) without checking out a consumer app.
3
- //
4
- // Consumer apps don't read this file — when the bridge is autolinked by a
5
- // React Native app, the consumer's own `settings.gradle` drives the build
6
- // and this one is ignored. Both paths coexist.
7
-
8
- pluginManagement {
9
- repositories {
10
- gradlePluginPortal()
11
- google()
12
- mavenCentral()
13
- }
14
- }
15
-
16
- dependencyResolutionManagement {
17
- // CI may run without autolinking providing repositories — declare them
18
- // here so `testImplementation 'com.facebook.react:react-android:+'` and
19
- // the `com.dashx:dashx-android:x.y.z` runtime dep resolve.
20
- repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
21
- repositories {
22
- google()
23
- mavenCentral()
24
- }
25
- }
26
-
27
- rootProject.name = 'dashx-react-native'
@@ -1,19 +0,0 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- xmlns:tools="http://schemas.android.com/tools">
3
-
4
- <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
5
-
6
- <application>
7
- <!-- Replace dashx-android's FCM service with our subclass that also emits to JS. -->
8
- <service
9
- android:name="com.dashx.android.DashXFirebaseMessagingService"
10
- tools:node="remove" />
11
- <service
12
- android:name="com.dashx.rn.sdk.DashXReactNativeFirebaseMessagingService"
13
- android:exported="false">
14
- <intent-filter>
15
- <action android:name="com.google.firebase.MESSAGING_EVENT" />
16
- </intent-filter>
17
- </service>
18
- </application>
19
- </manifest>
@@ -1,113 +0,0 @@
1
- package com.dashx.rn.sdk
2
-
3
- import com.dashx.android.DashXNotificationListener
4
- import com.dashx.android.DashXPayload
5
- import com.dashx.android.NavigationAction
6
- import com.dashx.rn.sdk.util.convertJsonToMap
7
- import com.facebook.react.bridge.Arguments
8
- import com.facebook.react.bridge.ReactApplicationContext
9
- import com.facebook.react.bridge.WritableMap
10
- import com.facebook.react.modules.core.DeviceEventManagerModule
11
- import kotlinx.serialization.json.Json
12
- import kotlinx.serialization.json.encodeToJsonElement
13
- import kotlinx.serialization.json.jsonObject
14
-
15
- /**
16
- * Bridges the dashx-android SDK's [DashXNotificationListener.onNotificationClicked]
17
- * hook to the JS-side `DashX.onNotificationClicked(...)` listener registered via
18
- * `NativeEventEmitter`. Mirrors the iOS emit shape from
19
- * `ios/DashXNotificationHandler.swift` → `handleNotificationResponse`:
20
- *
21
- * ```json
22
- * {
23
- * "notification": { ...DashX payload keys... },
24
- * "action": { "type": "deepLink" | "screen" | ..., ... } | null,
25
- * "actionIdentifier": "<string, or empty>"
26
- * }
27
- * ```
28
- *
29
- * Registered from [DashXReactNativeModuleImpl.initialize] via
30
- * [DashX.registerNotificationListener], and unregistered in [invalidate].
31
- *
32
- * Returns `false` from [onNotificationClicked] so the SDK proceeds with its
33
- * default navigation (deep-link intent, rich-landing browser, click-action
34
- * intent). Consumers who want to override need to do so in JS — the
35
- * JS-side listener has no way to suppress the native default via a return
36
- * value, which matches iOS behavior.
37
- *
38
- * `actionIdentifier` is `null` when the notification body was tapped, or the
39
- * tapped action button's identifier (matches `ActionButton.identifier`) for
40
- * button taps. We emit an empty string in the body-tap case so the JS event
41
- * always carries a String — matches the iOS event shape, where the field is
42
- * always present.
43
- */
44
- class DashXNotificationClickedListener(
45
- private val reactContext: ReactApplicationContext
46
- ) : DashXNotificationListener {
47
-
48
- override fun onNotificationClicked(
49
- payload: DashXPayload,
50
- action: NavigationAction?,
51
- actionIdentifier: String?
52
- ): Boolean {
53
- if (!reactContext.hasActiveReactInstance()) {
54
- // RN is still booting (common on cold-start from a killed-app
55
- // notification tap). The JS emit would be dropped anyway; skip.
56
- return false
57
- }
58
-
59
- val body: WritableMap = Arguments.createMap().apply {
60
- putMap("notification", payloadToMap(payload))
61
- if (action != null) {
62
- putMap("action", actionToMap(action))
63
- } else {
64
- putNull("action")
65
- }
66
- putString("actionIdentifier", actionIdentifier ?: "")
67
- }
68
-
69
- reactContext
70
- .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
71
- .emit("notificationClicked", body)
72
-
73
- return false
74
- }
75
-
76
- private fun payloadToMap(payload: DashXPayload): WritableMap {
77
- // DashXPayload is `@Serializable` — go straight to a JsonObject tree
78
- // and hand it to the shared `convertJsonToMap` helper for a
79
- // RN-bridge-safe `WritableMap`. No Gson / no string round-trip.
80
- val jsonObject = Json.encodeToJsonElement(DashXPayload.serializer(), payload).jsonObject
81
- return convertJsonToMap(jsonObject) ?: Arguments.createMap()
82
- }
83
-
84
- private fun actionToMap(action: NavigationAction): WritableMap {
85
- val map = Arguments.createMap()
86
- when (action) {
87
- is NavigationAction.DeepLink -> {
88
- map.putString("type", "deepLink")
89
- map.putString("url", action.url)
90
- }
91
- is NavigationAction.Screen -> {
92
- map.putString("type", "screen")
93
- map.putString("name", action.name)
94
- action.data?.let { data ->
95
- val dataMap = Arguments.createMap()
96
- for ((key, value) in data) {
97
- dataMap.putString(key, value)
98
- }
99
- map.putMap("data", dataMap)
100
- }
101
- }
102
- is NavigationAction.RichLanding -> {
103
- map.putString("type", "richLanding")
104
- map.putString("url", action.url)
105
- }
106
- is NavigationAction.ClickAction -> {
107
- map.putString("type", "clickAction")
108
- map.putString("action", action.action)
109
- }
110
- }
111
- return map
112
- }
113
- }
@@ -1,72 +0,0 @@
1
- package com.dashx.rn.sdk
2
-
3
- import com.dashx.android.DashXFirebaseMessagingService
4
- import com.dashx.android.DashXLog
5
- import com.facebook.react.bridge.Arguments
6
- import com.facebook.react.bridge.ReactApplicationContext
7
- import com.facebook.react.bridge.WritableMap
8
- import com.facebook.react.modules.core.DeviceEventManagerModule
9
- import com.google.firebase.messaging.RemoteMessage
10
-
11
- /**
12
- * Extends dashx-android's FCM service to also emit "messageReceived" to the React Native JS layer
13
- * so that DashX.onMessageReceived() callbacks receive push notifications.
14
- */
15
- class DashXReactNativeFirebaseMessagingService : DashXFirebaseMessagingService() {
16
-
17
- private val tag = DashXReactNativeFirebaseMessagingService::class.java.simpleName
18
-
19
- override fun onMessageReceived(remoteMessage: RemoteMessage) {
20
- // Preserve dashx-android behavior (notification display + tracking)
21
- super.onMessageReceived(remoteMessage)
22
-
23
- val context = MessageReceivedEventHolder.reactContext ?: run {
24
- DashXLog.d(tag, "React context not available, skipping JS emit")
25
- return
26
- }
27
-
28
- if (!context.hasActiveReactInstance()) {
29
- DashXLog.d(tag, "No active React instance, skipping JS emit")
30
- return
31
- }
32
-
33
- val payload = remoteMessageToWritableMap(remoteMessage)
34
- context.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
35
- .emit("messageReceived", payload)
36
- }
37
-
38
- private fun remoteMessageToWritableMap(remoteMessage: RemoteMessage): WritableMap {
39
- val map = Arguments.createMap()
40
-
41
- // Data payload (always present as Map<String, String>)
42
- remoteMessage.data.let { data ->
43
- if (!data.isNullOrEmpty()) {
44
- val dataMap = Arguments.createMap()
45
- for ((key, value) in data) {
46
- dataMap.putString(key, value)
47
- }
48
- map.putMap("data", dataMap)
49
- }
50
- }
51
-
52
- // Notification payload (if present)
53
- remoteMessage.notification?.let { notification ->
54
- val notifMap = Arguments.createMap()
55
- notification.title?.let { notifMap.putString("title", it) }
56
- notification.body?.let { notifMap.putString("body", it) }
57
- notification.bodyLocalizationKey?.let { notifMap.putString("bodyLocalizationKey", it) }
58
- notification.titleLocalizationKey?.let { notifMap.putString("titleLocalizationKey", it) }
59
- notification.channelId?.let { notifMap.putString("channelId", it) }
60
- notification.clickAction?.let { notifMap.putString("clickAction", it) }
61
- notification.tag?.let { notifMap.putString("tag", it) }
62
- notification.imageUrl?.toString()?.let { notifMap.putString("imageUrl", it) }
63
- map.putMap("notification", notifMap)
64
- }
65
-
66
- remoteMessage.messageId?.let { map.putString("messageId", it) }
67
- remoteMessage.senderId?.let { map.putString("senderId", it) }
68
- remoteMessage.from?.let { map.putString("from", it) }
69
-
70
- return map
71
- }
72
- }