@dashx/react-native 0.1.17 → 0.1.18

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 (94) hide show
  1. package/android/.gradle/6.9/executionHistory/executionHistory.bin +0 -0
  2. package/android/.gradle/6.9/executionHistory/executionHistory.lock +0 -0
  3. package/android/.gradle/6.9/fileHashes/fileHashes.bin +0 -0
  4. package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
  5. package/android/.gradle/6.9/fileHashes/resourceHashesCache.bin +0 -0
  6. package/android/.gradle/6.9/javaCompile/classAnalysis.bin +0 -0
  7. package/android/.gradle/6.9/javaCompile/jarAnalysis.bin +0 -0
  8. package/android/.gradle/6.9/javaCompile/javaCompile.lock +0 -0
  9. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  10. package/android/.gradle/checksums/checksums.lock +0 -0
  11. package/android/build/intermediates/packaged-classes/debug/classes.jar +0 -0
  12. package/android/build/intermediates/packaged-classes/release/classes.jar +0 -0
  13. package/android/build/kotlin/compileDebugKotlin/build-history.bin +0 -0
  14. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab +0 -0
  15. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  16. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  17. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  18. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  19. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  20. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  21. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  22. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab +0 -0
  23. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  24. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  25. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  26. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  27. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  28. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  29. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  30. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/counters.tab +2 -2
  31. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab +0 -0
  34. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.len +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.len +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.at +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.s +1 -1
  46. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/last-build.bin +0 -0
  48. package/android/build/kotlin/compileReleaseKotlin/build-history.bin +0 -0
  49. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/inputs/source-to-output.tab +0 -0
  50. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  51. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  52. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  53. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  54. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  55. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  56. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  57. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/proto.tab +0 -0
  58. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  59. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  60. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  61. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  62. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  63. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  64. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  65. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/counters.tab +2 -2
  66. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/file-to-id.tab +0 -0
  67. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  68. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/id-to-file.tab +0 -0
  69. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  70. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  71. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/id-to-file.tab.len +0 -0
  72. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  73. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/id-to-file.tab_i +0 -0
  74. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/lookups.tab +0 -0
  75. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/lookups.tab.keystream +0 -0
  76. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  77. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/lookups.tab.len +0 -0
  78. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/lookups.tab.values +0 -0
  79. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/lookups.tab.values.at +0 -0
  80. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/lookups.tab.values.s +1 -1
  81. package/android/build/kotlin/compileReleaseKotlin/caches-jvm/lookups/lookups.tab_i +0 -0
  82. package/android/build/kotlin/compileReleaseKotlin/last-build.bin +0 -0
  83. package/android/build/outputs/aar/android-debug.aar +0 -0
  84. package/android/build/outputs/aar/android-release.aar +0 -0
  85. package/android/build/reports/lint-results.html +8 -8
  86. package/android/build/reports/lint-results.xml +1 -1
  87. package/android/build/tmp/kotlin-classes/debug/com/dashx/rn/sdk/DashXMessagingService$Companion.class +0 -0
  88. package/android/build/tmp/kotlin-classes/debug/com/dashx/rn/sdk/DashXMessagingService.class +0 -0
  89. package/android/build/tmp/kotlin-classes/debug/com/dashx/rn/sdk/DashXPayload.class +0 -0
  90. package/android/build/tmp/kotlin-classes/release/com/dashx/rn/sdk/DashXMessagingService$Companion.class +0 -0
  91. package/android/build/tmp/kotlin-classes/release/com/dashx/rn/sdk/DashXMessagingService.class +0 -0
  92. package/android/build/tmp/kotlin-classes/release/com/dashx/rn/sdk/DashXPayload.class +0 -0
  93. package/android/src/main/java/com/dashx/rn/sdk/DashXMessagingService.kt +12 -0
  94. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- 17
2
- 9
1
+ 18
2
+ 10
@@ -1 +1 @@
1
- �D�G�<�6�6�.
1
+ �D�G�<�6�6�.�*
@@ -1,2 +1,2 @@
1
- 17
2
- 9
1
+ 18
2
+ 10
@@ -1 +1 @@
1
- �D�G�<�6�6�.
1
+ �D�G�<�6�6�.�*
@@ -176,7 +176,7 @@ document.getElementById(id).style.display = 'none';
176
176
  <span class="mdl-layout-title">Lint Report: 1 error and 1 warning</span>
177
177
  <div class="mdl-layout-spacer"></div>
178
178
  <nav class="mdl-navigation mdl-layout--large-screen-only">
179
- Check performed at Wed Apr 27 17:38:28 IST 2022 </nav>
179
+ Check performed at Thu Apr 28 08:53:55 IST 2022 </nav>
180
180
  </div>
181
181
  </header>
182
182
  <div class="mdl-layout__drawer">
@@ -223,13 +223,13 @@ Dismiss</button> </div>
223
223
  <div class="mdl-card__supporting-text">
224
224
  <div class="issue">
225
225
  <div class="warningslist">
226
- <span class="location"><a href="../../src/main/java/com/dashx/rn/sdk/DashXMessagingService.kt">../../src/main/java/com/dashx/rn/sdk/DashXMessagingService.kt</a>:102</span>: <span class="message">Field requires API level 23 (current min is 16): <code>android.app.PendingIntent#FLAG_IMMUTABLE</code></span><br /><pre class="errorlines">
227
- <span class="lineno"> 99 </span>
228
- <span class="lineno"> 100 </span> private <span class="keyword">fun</span> getNewPendingIntent(): PendingIntent {
229
- <span class="lineno"> 101 </span> <span class="keyword">val</span> context = getApplicationContext()
230
- <span class="caretline"><span class="lineno"> 102 </span> <span class="keyword">val</span> pendingIntentFlags = PendingIntent.FLAG_UPDATE_CURRENT or <span class="warning">PendingIntent.FLAG_IMMUTABLE</span>&nbsp;&nbsp;</span>
231
- <span class="lineno"> 103 </span>
232
- <span class="lineno"> 104 </span> <span class="keyword">val</span> intent = getNewBaseIntent()
226
+ <span class="location"><a href="../../src/main/java/com/dashx/rn/sdk/DashXMessagingService.kt">../../src/main/java/com/dashx/rn/sdk/DashXMessagingService.kt</a>:107</span>: <span class="message">Field requires API level 23 (current min is 16): <code>android.app.PendingIntent#FLAG_IMMUTABLE</code></span><br /><pre class="errorlines">
227
+ <span class="lineno"> 104 </span>
228
+ <span class="lineno"> 105 </span> private <span class="keyword">fun</span> getNewPendingIntent(): PendingIntent {
229
+ <span class="lineno"> 106 </span> <span class="keyword">val</span> context = getApplicationContext()
230
+ <span class="caretline"><span class="lineno"> 107 </span> <span class="keyword">val</span> pendingIntentFlags = PendingIntent.FLAG_UPDATE_CURRENT or <span class="warning">PendingIntent.FLAG_IMMUTABLE</span>&nbsp;&nbsp;</span>
231
+ <span class="lineno"> 108 </span>
232
+ <span class="lineno"> 109 </span> <span class="keyword">val</span> intent = getNewBaseIntent()
233
233
  </pre>
234
234
 
235
235
  </div>
@@ -13,7 +13,7 @@
13
13
  errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
14
14
  <location
15
15
  file="/home/dgulshan/Projects/dashx-js/packages/react-native/android/src/main/java/com/dashx/rn/sdk/DashXMessagingService.kt"
16
- line="102"
16
+ line="107"
17
17
  column="71"/>
18
18
  </issue>
19
19
 
@@ -1,6 +1,7 @@
1
1
  package com.dashx.rn.sdk
2
2
 
3
3
  import android.app.Activity
4
+ import android.app.ActivityManager
4
5
  import android.app.Notification
5
6
  import android.app.NotificationChannel
6
7
  import android.app.NotificationManager
@@ -42,6 +43,10 @@ class DashXMessagingService : FirebaseMessagingService() {
42
43
  override fun onMessageReceived(remoteMessage: RemoteMessage) {
43
44
  super.onMessageReceived(remoteMessage)
44
45
 
46
+ if (appInForeground()) {
47
+ return
48
+ }
49
+
45
50
  val dashxDataMap = remoteMessage.getData()["dashx"]
46
51
 
47
52
  if (dashxDataMap != null) {
@@ -156,6 +161,13 @@ class DashXMessagingService : FirebaseMessagingService() {
156
161
  return smallIconInt
157
162
  }
158
163
 
164
+ fun appInForeground(): Boolean {
165
+ val context = getApplicationContext()
166
+ val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
167
+ val runningAppProcesses = activityManager.runningAppProcesses ?: return false
168
+ return runningAppProcesses.any { it.processName == context.packageName && it.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND }
169
+ }
170
+
159
171
  companion object {
160
172
  private const val CHANNEL_NAME = "DashX Notification"
161
173
  private const val CHANNEL_DESCRIPTION = "DashX's default notification channel"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dashx/react-native",
3
3
  "title": "DashX React Native",
4
- "version": "0.1.17",
4
+ "version": "0.1.18",
5
5
  "description": "DashX SDK for React Native",
6
6
  "main": "index.js",
7
7
  "files": [