@kesha-antonov/react-native-background-downloader 4.5.2 → 4.5.4

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.
@@ -37,7 +37,7 @@ const config_plugins_1 = require("@expo/config-plugins");
37
37
  const fs = __importStar(require("fs"));
38
38
  const path = __importStar(require("path"));
39
39
  const withRNBackgroundDownloader = (config, options) => {
40
- const { mmkvVersion = '2.2.4', skipMmkvDependency = false } = options || {};
40
+ const { mmkvVersion = '1.3.16', skipMmkvDependency = false } = options || {};
41
41
  // Auto-detect react-native-mmkv in dependencies
42
42
  const hasReactNativeMmkv = checkForReactNativeMmkv(config);
43
43
  const shouldSkipMmkv = skipMmkvDependency || hasReactNativeMmkv;
@@ -90,7 +90,7 @@ export interface Spec extends TurboModule {
90
90
  setLogsEnabled(enabled: boolean): void
91
91
  setMaxParallelDownloads(max: number): void
92
92
  setAllowsCellularAccess(allows: boolean): void
93
- setNotificationGroupingConfig?(config: { enabled: boolean, showNotificationsEnabled: boolean, texts: UnsafeObject }): void
93
+ setNotificationGroupingConfig?(config: { enabled: boolean, showNotificationsEnabled: boolean, mode: string, texts: UnsafeObject }): void
94
94
 
95
95
  getExistingDownloadTasks(): Promise<Array<{
96
96
  id: string
package/src/config.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Headers, NotificationsGroupingConfig, NotificationTexts } from './types'
1
+ import { Headers, NotificationGroupingMode, NotificationsGroupingConfig, NotificationTexts } from './types'
2
2
 
3
3
  export const DEFAULT_PROGRESS_INTERVAL = 1000
4
4
  export const DEFAULT_PROGRESS_MIN_BYTES = 1024 * 1024 // 1MB
@@ -28,7 +28,7 @@ interface ConfigState {
28
28
  maxParallelDownloads: number
29
29
  allowsCellularAccess: boolean
30
30
  showNotificationsEnabled: boolean
31
- notificationsGrouping: NotificationsGroupingConfig
31
+ notificationsGrouping: NotificationsGroupingConfig & { mode: NotificationGroupingMode }
32
32
  }
33
33
 
34
34
  export const config: ConfigState = {
@@ -42,6 +42,7 @@ export const config: ConfigState = {
42
42
  showNotificationsEnabled: false,
43
43
  notificationsGrouping: {
44
44
  enabled: false,
45
+ mode: 'individual',
45
46
  texts: DEFAULT_NOTIFICATION_TEXTS,
46
47
  },
47
48
  }
package/src/index.ts CHANGED
@@ -402,6 +402,7 @@ export function setConfig ({
402
402
  if (notificationsGrouping !== undefined)
403
403
  config.notificationsGrouping = {
404
404
  enabled: notificationsGrouping.enabled ?? false,
405
+ mode: notificationsGrouping.mode ?? 'individual',
405
406
  texts: {
406
407
  ...DEFAULT_NOTIFICATION_TEXTS,
407
408
  ...notificationsGrouping.texts,
@@ -417,7 +418,7 @@ export function setConfig ({
417
418
  setLogsEnabled?: (enabled: boolean) => void
418
419
  setMaxParallelDownloads?: (max: number) => void
419
420
  setAllowsCellularAccess?: (allows: boolean) => void
420
- setNotificationGroupingConfig?: (config: { enabled: boolean, showNotificationsEnabled: boolean, texts: Record<string, string> }) => void
421
+ setNotificationGroupingConfig?: (config: { enabled: boolean, showNotificationsEnabled: boolean, mode: string, texts: Record<string, string> }) => void
421
422
  }
422
423
  if (nativeModule.setLogsEnabled)
423
424
  nativeModule.setLogsEnabled(isLogsEnabled)
@@ -431,6 +432,7 @@ export function setConfig ({
431
432
  nativeModule.setNotificationGroupingConfig({
432
433
  enabled: config.notificationsGrouping.enabled,
433
434
  showNotificationsEnabled: config.showNotificationsEnabled ?? false,
435
+ mode: config.notificationsGrouping.mode,
434
436
  texts: getNotificationTextsForNative(),
435
437
  })
436
438
  } catch {
package/src/types.ts CHANGED
@@ -28,12 +28,21 @@ export interface NotificationTexts {
28
28
  groupText?: string | ((count: number) => string)
29
29
  }
30
30
 
31
+ /**
32
+ * Mode for notification display when grouping is enabled.
33
+ * - 'individual': Show all notifications (default, current behavior)
34
+ * - 'summaryOnly': Show only summary notification, minimize individual ones
35
+ */
36
+ export type NotificationGroupingMode = 'individual' | 'summaryOnly'
37
+
31
38
  /**
32
39
  * Configuration for notifications grouping.
33
40
  */
34
41
  export interface NotificationsGroupingConfig {
35
42
  /** Enable notification grouping (default: false) */
36
43
  enabled: boolean
44
+ /** Mode for notification display (default: 'individual') */
45
+ mode?: NotificationGroupingMode
37
46
  /** Custom notification texts with optional pluralization */
38
47
  texts?: NotificationTexts
39
48
  }
@@ -1,6 +0,0 @@
1
- {
2
- "name": "@kesha-antonov/react-native-background-downloader-expo-plugin",
3
- "version": "1.0.0",
4
- "main": "build/index.js",
5
- "types": "build/index.d.ts"
6
- }