@symbiote-native/notifications 0.1.0

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/LICENSE +21 -0
  2. package/README.md +258 -0
  3. package/build/angular/index.d.ts +1 -0
  4. package/build/angular/index.js +1 -0
  5. package/build/core/background-task.d.ts +9 -0
  6. package/build/core/background-task.js +28 -0
  7. package/build/core/badge.d.ts +7 -0
  8. package/build/core/badge.js +23 -0
  9. package/build/core/categories.d.ts +10 -0
  10. package/build/core/categories.js +28 -0
  11. package/build/core/channels.d.ts +20 -0
  12. package/build/core/channels.js +106 -0
  13. package/build/core/emitter.d.ts +24 -0
  14. package/build/core/emitter.js +58 -0
  15. package/build/core/handler.d.ts +15 -0
  16. package/build/core/handler.js +50 -0
  17. package/build/core/index.d.ts +12 -0
  18. package/build/core/index.js +11 -0
  19. package/build/core/native-modules.d.ts +82 -0
  20. package/build/core/native-modules.js +33 -0
  21. package/build/core/permissions.d.ts +8 -0
  22. package/build/core/permissions.js +30 -0
  23. package/build/core/presenter.d.ts +7 -0
  24. package/build/core/presenter.js +27 -0
  25. package/build/core/scheduler.d.ts +13 -0
  26. package/build/core/scheduler.js +193 -0
  27. package/build/core/tokens.d.ts +30 -0
  28. package/build/core/tokens.js +192 -0
  29. package/build/core/types.d.ts +633 -0
  30. package/build/core/types.js +116 -0
  31. package/build/core/utils.d.ts +6 -0
  32. package/build/core/utils.js +53 -0
  33. package/build-ngc/angular/index.d.ts +1 -0
  34. package/build-ngc/angular/index.js +2 -0
  35. package/build-ngc/angular/index.js.map +1 -0
  36. package/build-ngc/core/background-task.d.ts +9 -0
  37. package/build-ngc/core/background-task.js +29 -0
  38. package/build-ngc/core/background-task.js.map +1 -0
  39. package/build-ngc/core/badge.d.ts +7 -0
  40. package/build-ngc/core/badge.js +24 -0
  41. package/build-ngc/core/badge.js.map +1 -0
  42. package/build-ngc/core/categories.d.ts +10 -0
  43. package/build-ngc/core/categories.js +29 -0
  44. package/build-ngc/core/categories.js.map +1 -0
  45. package/build-ngc/core/channels.d.ts +20 -0
  46. package/build-ngc/core/channels.js +107 -0
  47. package/build-ngc/core/channels.js.map +1 -0
  48. package/build-ngc/core/emitter.d.ts +24 -0
  49. package/build-ngc/core/emitter.js +59 -0
  50. package/build-ngc/core/emitter.js.map +1 -0
  51. package/build-ngc/core/handler.d.ts +15 -0
  52. package/build-ngc/core/handler.js +51 -0
  53. package/build-ngc/core/handler.js.map +1 -0
  54. package/build-ngc/core/index.d.ts +12 -0
  55. package/build-ngc/core/index.js +12 -0
  56. package/build-ngc/core/index.js.map +1 -0
  57. package/build-ngc/core/native-modules.d.ts +82 -0
  58. package/build-ngc/core/native-modules.js +34 -0
  59. package/build-ngc/core/native-modules.js.map +1 -0
  60. package/build-ngc/core/permissions.d.ts +8 -0
  61. package/build-ngc/core/permissions.js +31 -0
  62. package/build-ngc/core/permissions.js.map +1 -0
  63. package/build-ngc/core/presenter.d.ts +7 -0
  64. package/build-ngc/core/presenter.js +28 -0
  65. package/build-ngc/core/presenter.js.map +1 -0
  66. package/build-ngc/core/scheduler.d.ts +13 -0
  67. package/build-ngc/core/scheduler.js +194 -0
  68. package/build-ngc/core/scheduler.js.map +1 -0
  69. package/build-ngc/core/tokens.d.ts +30 -0
  70. package/build-ngc/core/tokens.js +193 -0
  71. package/build-ngc/core/tokens.js.map +1 -0
  72. package/build-ngc/core/types.d.ts +633 -0
  73. package/build-ngc/core/types.js +117 -0
  74. package/build-ngc/core/types.js.map +1 -0
  75. package/build-ngc/core/utils.d.ts +6 -0
  76. package/build-ngc/core/utils.js +54 -0
  77. package/build-ngc/core/utils.js.map +1 -0
  78. package/native-link.json +88 -0
  79. package/package.json +150 -0
  80. package/src/angular/index.ts +1 -0
  81. package/src/core/background-task.ts +32 -0
  82. package/src/core/badge.ts +26 -0
  83. package/src/core/categories.ts +60 -0
  84. package/src/core/channels.ts +183 -0
  85. package/src/core/emitter.ts +95 -0
  86. package/src/core/handler.ts +95 -0
  87. package/src/core/index.ts +144 -0
  88. package/src/core/native-modules.ts +209 -0
  89. package/src/core/permissions.ts +46 -0
  90. package/src/core/presenter.ts +45 -0
  91. package/src/core/scheduler.ts +265 -0
  92. package/src/core/tokens.ts +272 -0
  93. package/src/core/types.ts +767 -0
  94. package/src/core/utils.ts +82 -0
@@ -0,0 +1,117 @@
1
+ // Hand-ported from expo-notifications @ sdk-57 (Notifications.types.ts / Tokens.types.ts /
2
+ // NotificationChannelManager.types.ts / NotificationChannelGroupManager.types.ts /
3
+ // NotificationScheduler.types.ts) — this repo's own `I`-prefix convention for public types.
4
+ //
5
+ // PermissionResponse/PermissionStatus/PermissionExpiration come straight from
6
+ // expo-modules-core (the same precedent packages/sensors and packages/local-auth already use),
7
+ // not redeclared here.
8
+ import { PermissionStatus, } from 'expo-modules-core';
9
+ export { PermissionStatus };
10
+ // ---------------------------------------------------------------------------
11
+ // Permissions
12
+ // ---------------------------------------------------------------------------
13
+ /** @platform ios */
14
+ export var IosAlertStyle;
15
+ (function (IosAlertStyle) {
16
+ IosAlertStyle[IosAlertStyle["NONE"] = 0] = "NONE";
17
+ IosAlertStyle[IosAlertStyle["BANNER"] = 1] = "BANNER";
18
+ IosAlertStyle[IosAlertStyle["ALERT"] = 2] = "ALERT";
19
+ })(IosAlertStyle || (IosAlertStyle = {}));
20
+ /** @platform ios */
21
+ export var IosAllowsPreviews;
22
+ (function (IosAllowsPreviews) {
23
+ IosAllowsPreviews[IosAllowsPreviews["NEVER"] = 0] = "NEVER";
24
+ IosAllowsPreviews[IosAllowsPreviews["ALWAYS"] = 1] = "ALWAYS";
25
+ IosAllowsPreviews[IosAllowsPreviews["WHEN_AUTHENTICATED"] = 2] = "WHEN_AUTHENTICATED";
26
+ })(IosAllowsPreviews || (IosAllowsPreviews = {}));
27
+ /** @platform ios */
28
+ export var IosAuthorizationStatus;
29
+ (function (IosAuthorizationStatus) {
30
+ IosAuthorizationStatus[IosAuthorizationStatus["NOT_DETERMINED"] = 0] = "NOT_DETERMINED";
31
+ IosAuthorizationStatus[IosAuthorizationStatus["DENIED"] = 1] = "DENIED";
32
+ IosAuthorizationStatus[IosAuthorizationStatus["AUTHORIZED"] = 2] = "AUTHORIZED";
33
+ IosAuthorizationStatus[IosAuthorizationStatus["PROVISIONAL"] = 3] = "PROVISIONAL";
34
+ IosAuthorizationStatus[IosAuthorizationStatus["EPHEMERAL"] = 4] = "EPHEMERAL";
35
+ })(IosAuthorizationStatus || (IosAuthorizationStatus = {}));
36
+ export var SchedulableTriggerInputTypes;
37
+ (function (SchedulableTriggerInputTypes) {
38
+ SchedulableTriggerInputTypes["CALENDAR"] = "calendar";
39
+ SchedulableTriggerInputTypes["DAILY"] = "daily";
40
+ SchedulableTriggerInputTypes["WEEKLY"] = "weekly";
41
+ SchedulableTriggerInputTypes["MONTHLY"] = "monthly";
42
+ SchedulableTriggerInputTypes["YEARLY"] = "yearly";
43
+ SchedulableTriggerInputTypes["DATE"] = "date";
44
+ SchedulableTriggerInputTypes["TIME_INTERVAL"] = "timeInterval";
45
+ })(SchedulableTriggerInputTypes || (SchedulableTriggerInputTypes = {}));
46
+ /** @platform android */
47
+ export var AndroidNotificationPriority;
48
+ (function (AndroidNotificationPriority) {
49
+ AndroidNotificationPriority["MIN"] = "min";
50
+ AndroidNotificationPriority["LOW"] = "low";
51
+ AndroidNotificationPriority["DEFAULT"] = "default";
52
+ AndroidNotificationPriority["HIGH"] = "high";
53
+ AndroidNotificationPriority["MAX"] = "max";
54
+ })(AndroidNotificationPriority || (AndroidNotificationPriority = {}));
55
+ // ---------------------------------------------------------------------------
56
+ // Android channels / channel groups
57
+ // ---------------------------------------------------------------------------
58
+ /** @platform android */
59
+ export var AndroidNotificationVisibility;
60
+ (function (AndroidNotificationVisibility) {
61
+ AndroidNotificationVisibility[AndroidNotificationVisibility["UNKNOWN"] = 0] = "UNKNOWN";
62
+ AndroidNotificationVisibility[AndroidNotificationVisibility["PUBLIC"] = 1] = "PUBLIC";
63
+ AndroidNotificationVisibility[AndroidNotificationVisibility["PRIVATE"] = 2] = "PRIVATE";
64
+ AndroidNotificationVisibility[AndroidNotificationVisibility["SECRET"] = 3] = "SECRET";
65
+ })(AndroidNotificationVisibility || (AndroidNotificationVisibility = {}));
66
+ /** @platform android */
67
+ export var AndroidAudioContentType;
68
+ (function (AndroidAudioContentType) {
69
+ AndroidAudioContentType[AndroidAudioContentType["UNKNOWN"] = 0] = "UNKNOWN";
70
+ AndroidAudioContentType[AndroidAudioContentType["SPEECH"] = 1] = "SPEECH";
71
+ AndroidAudioContentType[AndroidAudioContentType["MUSIC"] = 2] = "MUSIC";
72
+ AndroidAudioContentType[AndroidAudioContentType["MOVIE"] = 3] = "MOVIE";
73
+ AndroidAudioContentType[AndroidAudioContentType["SONIFICATION"] = 4] = "SONIFICATION";
74
+ })(AndroidAudioContentType || (AndroidAudioContentType = {}));
75
+ /** @platform android */
76
+ export var AndroidImportance;
77
+ (function (AndroidImportance) {
78
+ AndroidImportance[AndroidImportance["UNKNOWN"] = 0] = "UNKNOWN";
79
+ /** Use `DEFAULT` instead — present for compatibility only. */
80
+ AndroidImportance[AndroidImportance["UNSPECIFIED"] = 1] = "UNSPECIFIED";
81
+ AndroidImportance[AndroidImportance["NONE"] = 2] = "NONE";
82
+ AndroidImportance[AndroidImportance["MIN"] = 3] = "MIN";
83
+ AndroidImportance[AndroidImportance["LOW"] = 4] = "LOW";
84
+ AndroidImportance[AndroidImportance["DEFAULT"] = 5] = "DEFAULT";
85
+ AndroidImportance[AndroidImportance["HIGH"] = 6] = "HIGH";
86
+ AndroidImportance[AndroidImportance["MAX"] = 7] = "MAX";
87
+ })(AndroidImportance || (AndroidImportance = {}));
88
+ /** @platform android */
89
+ export var AndroidAudioUsage;
90
+ (function (AndroidAudioUsage) {
91
+ AndroidAudioUsage[AndroidAudioUsage["UNKNOWN"] = 0] = "UNKNOWN";
92
+ AndroidAudioUsage[AndroidAudioUsage["MEDIA"] = 1] = "MEDIA";
93
+ AndroidAudioUsage[AndroidAudioUsage["VOICE_COMMUNICATION"] = 2] = "VOICE_COMMUNICATION";
94
+ AndroidAudioUsage[AndroidAudioUsage["VOICE_COMMUNICATION_SIGNALLING"] = 3] = "VOICE_COMMUNICATION_SIGNALLING";
95
+ AndroidAudioUsage[AndroidAudioUsage["ALARM"] = 4] = "ALARM";
96
+ AndroidAudioUsage[AndroidAudioUsage["NOTIFICATION"] = 5] = "NOTIFICATION";
97
+ AndroidAudioUsage[AndroidAudioUsage["NOTIFICATION_RINGTONE"] = 6] = "NOTIFICATION_RINGTONE";
98
+ AndroidAudioUsage[AndroidAudioUsage["NOTIFICATION_COMMUNICATION_REQUEST"] = 7] = "NOTIFICATION_COMMUNICATION_REQUEST";
99
+ AndroidAudioUsage[AndroidAudioUsage["NOTIFICATION_COMMUNICATION_INSTANT"] = 8] = "NOTIFICATION_COMMUNICATION_INSTANT";
100
+ AndroidAudioUsage[AndroidAudioUsage["NOTIFICATION_COMMUNICATION_DELAYED"] = 9] = "NOTIFICATION_COMMUNICATION_DELAYED";
101
+ AndroidAudioUsage[AndroidAudioUsage["NOTIFICATION_EVENT"] = 10] = "NOTIFICATION_EVENT";
102
+ AndroidAudioUsage[AndroidAudioUsage["ASSISTANCE_ACCESSIBILITY"] = 11] = "ASSISTANCE_ACCESSIBILITY";
103
+ AndroidAudioUsage[AndroidAudioUsage["ASSISTANCE_NAVIGATION_GUIDANCE"] = 12] = "ASSISTANCE_NAVIGATION_GUIDANCE";
104
+ AndroidAudioUsage[AndroidAudioUsage["ASSISTANCE_SONIFICATION"] = 13] = "ASSISTANCE_SONIFICATION";
105
+ AndroidAudioUsage[AndroidAudioUsage["GAME"] = 14] = "GAME";
106
+ })(AndroidAudioUsage || (AndroidAudioUsage = {}));
107
+ // ---------------------------------------------------------------------------
108
+ // Background task
109
+ // ---------------------------------------------------------------------------
110
+ /** Corresponds to `UIBackgroundFetchResult`. @platform ios */
111
+ export var BackgroundNotificationTaskResult;
112
+ (function (BackgroundNotificationTaskResult) {
113
+ BackgroundNotificationTaskResult[BackgroundNotificationTaskResult["NewData"] = 0] = "NewData";
114
+ BackgroundNotificationTaskResult[BackgroundNotificationTaskResult["NoData"] = 1] = "NoData";
115
+ BackgroundNotificationTaskResult[BackgroundNotificationTaskResult["Failed"] = 2] = "Failed";
116
+ })(BackgroundNotificationTaskResult || (BackgroundNotificationTaskResult = {}));
117
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,6 @@
1
+ import type { INotification, INotificationContent, INotificationRequest, INotificationResponse } from './types';
2
+ export declare function hasValidTriggerObject(trigger: unknown): boolean;
3
+ export declare function mapNotificationContent(content: INotificationContent): INotificationContent;
4
+ export declare function mapNotificationRequest(request: INotificationRequest): INotificationRequest;
5
+ export declare function mapNotification(notification: INotification): INotification;
6
+ export declare function mapNotificationResponse(response: INotificationResponse): INotificationResponse;
@@ -0,0 +1,54 @@
1
+ export function hasValidTriggerObject(trigger) {
2
+ if (trigger === null)
3
+ return true;
4
+ if (typeof trigger !== 'object')
5
+ return false;
6
+ return 'type' in trigger || 'channelId' in trigger;
7
+ }
8
+ let warnedAboutDataString = false;
9
+ // Native hands over a raw payload that may carry a legacy `dataString` field this package's own
10
+ // `INotificationContent` type does not declare — the one narrowing boundary for that dynamic
11
+ // extra field lives here, not scattered across call sites.
12
+ function readLegacyDataString(content) {
13
+ const record = content;
14
+ const dataString = record.dataString;
15
+ return typeof dataString === 'string' ? dataString : undefined;
16
+ }
17
+ export function mapNotificationContent(content) {
18
+ try {
19
+ const dataString = readLegacyDataString(content);
20
+ if (typeof dataString === 'string') {
21
+ const mapped = {
22
+ ...content,
23
+ };
24
+ mapped.data = JSON.parse(dataString);
25
+ Object.defineProperty(mapped, 'dataString', {
26
+ get() {
27
+ if (!warnedAboutDataString) {
28
+ warnedAboutDataString = true;
29
+ console.warn('[notifications] reading dataString is deprecated, use data instead');
30
+ }
31
+ return dataString;
32
+ },
33
+ });
34
+ return mapped;
35
+ }
36
+ }
37
+ catch (error) {
38
+ console.error(`[notifications] Error parsing notification content: ${error}`);
39
+ }
40
+ return content;
41
+ }
42
+ export function mapNotificationRequest(request) {
43
+ return { ...request, content: mapNotificationContent(request.content) };
44
+ }
45
+ export function mapNotification(notification) {
46
+ return {
47
+ ...notification,
48
+ request: mapNotificationRequest(notification.request),
49
+ };
50
+ }
51
+ export function mapNotificationResponse(response) {
52
+ return { ...response, notification: mapNotification(response.notification) };
53
+ }
54
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAClC,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9C,OAAO,MAAM,IAAI,OAAO,IAAI,WAAW,IAAI,OAAO,CAAC;AACrD,CAAC;AAED,IAAI,qBAAqB,GAAG,KAAK,CAAC;AAElC,gGAAgG;AAChG,6FAA6F;AAC7F,2DAA2D;AAC3D,SAAS,oBAAoB,CAC3B,OAA6B;IAE7B,MAAM,MAAM,GAA4B,OAAO,CAAC;IAChD,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IACrC,OAAO,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,OAA6B;IAE7B,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YACnC,MAAM,MAAM,GAAmD;gBAC7D,GAAG,OAAO;aACX,CAAC;YACF,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACrC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE;gBAC1C,GAAG;oBACD,IAAI,CAAC,qBAAqB,EAAE,CAAC;wBAC3B,qBAAqB,GAAG,IAAI,CAAC;wBAC7B,OAAO,CAAC,IAAI,CACV,oEAAoE,CACrE,CAAC;oBACJ,CAAC;oBACD,OAAO,UAAU,CAAC;gBACpB,CAAC;aACF,CAAC,CAAC;YACH,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CACX,uDAAuD,KAAK,EAAE,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,OAA6B;IAE7B,OAAO,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,sBAAsB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,YAA2B;IACzD,OAAO;QACL,GAAG,YAAY;QACf,OAAO,EAAE,sBAAsB,CAAC,YAAY,CAAC,OAAO,CAAC;KACtD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,QAA+B;IAE/B,OAAO,EAAE,GAAG,QAAQ,EAAE,YAAY,EAAE,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;AAC/E,CAAC"}
@@ -0,0 +1,88 @@
1
+ {
2
+ "android": {
3
+ "gradleProjectName": "expo-notifications",
4
+ "modules": [
5
+ {
6
+ "importPath": "expo.modules.notifications.badge.BadgeModule",
7
+ "className": "BadgeModule",
8
+ "nativeName": "ExpoBadgeModule"
9
+ },
10
+ {
11
+ "importPath": "expo.modules.notifications.notifications.background.ExpoBackgroundNotificationTasksModule",
12
+ "className": "ExpoBackgroundNotificationTasksModule",
13
+ "nativeName": "ExpoBackgroundNotificationTasksModule"
14
+ },
15
+ {
16
+ "importPath": "expo.modules.notifications.notifications.categories.ExpoNotificationCategoriesModule",
17
+ "className": "ExpoNotificationCategoriesModule",
18
+ "nativeName": "ExpoNotificationCategoriesModule"
19
+ },
20
+ {
21
+ "importPath": "expo.modules.notifications.notifications.channels.NotificationChannelGroupManagerModule",
22
+ "className": "NotificationChannelGroupManagerModule",
23
+ "nativeName": "ExpoNotificationChannelGroupManager"
24
+ },
25
+ {
26
+ "importPath": "expo.modules.notifications.notifications.channels.NotificationChannelManagerModule",
27
+ "className": "NotificationChannelManagerModule",
28
+ "nativeName": "ExpoNotificationChannelManager"
29
+ },
30
+ {
31
+ "importPath": "expo.modules.notifications.notifications.emitting.NotificationsEmitter",
32
+ "className": "NotificationsEmitter",
33
+ "nativeName": "ExpoNotificationsEmitter"
34
+ },
35
+ {
36
+ "importPath": "expo.modules.notifications.notifications.handling.NotificationsHandler",
37
+ "className": "NotificationsHandler",
38
+ "nativeName": "ExpoNotificationsHandlerModule"
39
+ },
40
+ {
41
+ "importPath": "expo.modules.notifications.permissions.NotificationPermissionsModule",
42
+ "className": "NotificationPermissionsModule",
43
+ "nativeName": "ExpoNotificationPermissionsModule"
44
+ },
45
+ {
46
+ "importPath": "expo.modules.notifications.notifications.presentation.ExpoNotificationPresentationModule",
47
+ "className": "ExpoNotificationPresentationModule",
48
+ "nativeName": "ExpoNotificationPresenter"
49
+ },
50
+ {
51
+ "importPath": "expo.modules.notifications.notifications.scheduling.NotificationScheduler",
52
+ "className": "NotificationScheduler",
53
+ "nativeName": "ExpoNotificationScheduler"
54
+ },
55
+ {
56
+ "importPath": "expo.modules.notifications.serverregistration.ServerRegistrationModule",
57
+ "className": "ServerRegistrationModule",
58
+ "nativeName": "NotificationsServerRegistrationModule"
59
+ },
60
+ {
61
+ "importPath": "expo.modules.notifications.tokens.PushTokenModule",
62
+ "className": "PushTokenModule",
63
+ "nativeName": "ExpoPushTokenManager"
64
+ },
65
+ {
66
+ "importPath": "expo.modules.notifications.topics.TopicSubscriptionModule",
67
+ "className": "TopicSubscriptionModule",
68
+ "nativeName": "ExpoTopicSubscriptionModule"
69
+ },
70
+ {
71
+ "importPath": "expo.modules.notifications.notifications.channels.AndroidXNotificationsChannelsProvider",
72
+ "className": "AndroidXNotificationsChannelsProvider",
73
+ "nativeName": "NotificationsChannelsProvider",
74
+ "internal": true
75
+ }
76
+ ]
77
+ },
78
+ "reviewedNonIntrospectableMods": [
79
+ {
80
+ "mod": "android.dangerous",
81
+ "note": "withNotificationIcons/withNotificationSounds (expo-notifications' withNotificationsAndroid.js) run unconditionally with icon:null, sounds:[] by default — icon:null only unlinks a previously-written notification icon PNG if one exists (existsSync-gated), and an empty sounds array copies zero files. No-op for every consumer: this repo never sets a custom notification icon/color/sounds anywhere."
82
+ },
83
+ {
84
+ "mod": "ios.xcodeproj",
85
+ "note": "withNotificationSounds' iOS half (withNotificationsIOS.js) copies each entry of `sounds` (default []) into the Xcode project via setNotificationSounds — an empty array loops zero times, so it's a no-op with our defaults. Note it also has a hard `if (!projectName) throw` path, but that's unreachable here since this mod is stripped from every introspected run before executing at all (xcodeproj is not isIntrospective)."
86
+ }
87
+ ]
88
+ }
package/package.json ADDED
@@ -0,0 +1,150 @@
1
+ {
2
+ "name": "@symbiote-native/notifications",
3
+ "version": "0.1.0",
4
+ "description": "expo-notifications wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Permissions, device/Expo push tokens, scheduling, presentation, badges, Android channels/channel groups, categories, and the background notification task hook.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/OneEyed1366/symbiote-native.git",
9
+ "directory": "packages/notifications"
10
+ },
11
+ "homepage": "https://github.com/OneEyed1366/symbiote-native/tree/master/packages/notifications#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/OneEyed1366/symbiote-native/issues"
14
+ },
15
+ "author": "Andrey Prokopenko <psevdoproger@gmail.com>",
16
+ "keywords": [
17
+ "react-native",
18
+ "symbiote-native",
19
+ "expo-notifications",
20
+ "react",
21
+ "vue",
22
+ "svelte",
23
+ "solid",
24
+ "angular",
25
+ "push-notifications",
26
+ "notifications"
27
+ ],
28
+ "type": "module",
29
+ "main": "./build/core/index.js",
30
+ "module": "./build/core/index.js",
31
+ "types": "./build/core/index.d.ts",
32
+ "exports": {
33
+ ".": {
34
+ "types": "./build/core/index.d.ts",
35
+ "default": "./build/core/index.js"
36
+ },
37
+ "./vue": {
38
+ "types": "./build/core/index.d.ts",
39
+ "default": "./build/core/index.js"
40
+ },
41
+ "./react": {
42
+ "types": "./build/core/index.d.ts",
43
+ "default": "./build/core/index.js"
44
+ },
45
+ "./svelte": {
46
+ "types": "./build/core/index.d.ts",
47
+ "default": "./build/core/index.js"
48
+ },
49
+ "./solid": {
50
+ "types": "./build/core/index.d.ts",
51
+ "default": "./build/core/index.js"
52
+ },
53
+ "./angular": {
54
+ "types": "./build-ngc/angular/index.d.ts",
55
+ "react-native": "./build-ngc/angular/index.js",
56
+ "default": "./src/angular/index.ts"
57
+ }
58
+ },
59
+ "files": [
60
+ "src",
61
+ "build",
62
+ "build-ngc",
63
+ "native-link.json",
64
+ "!src/**/*.test.*",
65
+ "!src/**/*.spec.*",
66
+ "!src/**/*.detox.*"
67
+ ],
68
+ "publishConfig": {
69
+ "access": "public"
70
+ },
71
+ "dependencies": {
72
+ "expo-notifications": "57.0.17",
73
+ "expo-modules-core": "57.0.5"
74
+ },
75
+ "peerDependencies": {
76
+ "@angular/core": ">=20",
77
+ "@vue/runtime-core": "^3.5.13",
78
+ "react": ">=19.0.0",
79
+ "react-native": ">=0.86",
80
+ "solid-js": ">=1.9.0",
81
+ "svelte": ">=5.56.0",
82
+ "vue": ">=3.5.0",
83
+ "@symbiote-native/angular": "^3.1.0",
84
+ "@symbiote-native/engine": "^1.3.0",
85
+ "@symbiote-native/react": "^3.0.2",
86
+ "@symbiote-native/solid": "^3.0.2",
87
+ "@symbiote-native/svelte": "^3.0.2",
88
+ "@symbiote-native/vue": "^3.0.2"
89
+ },
90
+ "peerDependenciesMeta": {
91
+ "@symbiote-native/angular": {
92
+ "optional": true
93
+ },
94
+ "@symbiote-native/react": {
95
+ "optional": true
96
+ },
97
+ "@symbiote-native/solid": {
98
+ "optional": true
99
+ },
100
+ "@symbiote-native/svelte": {
101
+ "optional": true
102
+ },
103
+ "@symbiote-native/vue": {
104
+ "optional": true
105
+ },
106
+ "@angular/core": {
107
+ "optional": true
108
+ },
109
+ "@vue/runtime-core": {
110
+ "optional": true
111
+ },
112
+ "react": {
113
+ "optional": true
114
+ },
115
+ "solid-js": {
116
+ "optional": true
117
+ },
118
+ "svelte": {
119
+ "optional": true
120
+ },
121
+ "vue": {
122
+ "optional": true
123
+ }
124
+ },
125
+ "devDependencies": {
126
+ "@angular/compiler": "~22.0.8",
127
+ "@angular/compiler-cli": "~22.0.8",
128
+ "@angular/core": "~22.0.8",
129
+ "@types/node": "^26.0.0",
130
+ "@types/react": "^19.2.0",
131
+ "@vue/runtime-core": "^3.5.13",
132
+ "react": "19.2.3",
133
+ "solid-js": "^1.9.14",
134
+ "svelte": "^5.56.0",
135
+ "typescript": "~6.0.0",
136
+ "@symbiote-native/angular": "3.1.0",
137
+ "@symbiote-native/engine": "1.3.0",
138
+ "@symbiote-native/vue": "3.0.2",
139
+ "@symbiote-native/test-utils": "0.4.2",
140
+ "@symbiote-native/svelte": "3.0.2",
141
+ "@symbiote-native/solid": "3.0.2",
142
+ "@symbiote-native/react": "3.0.2"
143
+ },
144
+ "scripts": {
145
+ "typecheck": "tsc --build",
146
+ "clean": "rm -rf build-ngc",
147
+ "ng:build": "pnpm run clean && ngc -p tsconfig.angular.json",
148
+ "format": "prettier --write \"src/**/*.{ts,tsx}\""
149
+ }
150
+ }
@@ -0,0 +1 @@
1
+ export * from '../core';
@@ -0,0 +1,32 @@
1
+ // Ported from expo-notifications @ sdk-57's registerTaskAsync.ts / unregisterTaskAsync.ts.
2
+ //
3
+ // Runs on `@symbiote-native/task-manager` under the hood, exactly like upstream runs on
4
+ // `expo-task-manager` — `TaskManager.defineTask(taskName, executor)` must be called first, at
5
+ // the top of the JS bundle (outside any component), then this function tells native to start
6
+ // delivering into that task. See this package's README for the full wiring, including why the
7
+ // task also needs `@symbiote-native/task-manager` installed.
8
+ import { UnavailabilityError } from 'expo-modules-core';
9
+
10
+ import { backgroundNotificationTasksModule } from './native-modules';
11
+
12
+ export { BackgroundNotificationTaskResult } from './types';
13
+
14
+ /**
15
+ * Starts delivering notification-received/response events (and, when the app is terminated,
16
+ * headless background notifications) into a task already defined with
17
+ * `TaskManager.defineTask(taskName, …)`.
18
+ */
19
+ export async function registerTaskAsync(taskName: string): Promise<null> {
20
+ if (!backgroundNotificationTasksModule.registerTaskAsync) {
21
+ throw new UnavailabilityError('Notifications', 'registerTaskAsync');
22
+ }
23
+ return backgroundNotificationTasksModule.registerTaskAsync(taskName);
24
+ }
25
+
26
+ /** Stops delivering into a task registered with `registerTaskAsync`. */
27
+ export async function unregisterTaskAsync(taskName: string): Promise<null> {
28
+ if (!backgroundNotificationTasksModule.unregisterTaskAsync) {
29
+ throw new UnavailabilityError('Notifications', 'unregisterTaskAsync');
30
+ }
31
+ return backgroundNotificationTasksModule.unregisterTaskAsync(taskName);
32
+ }
@@ -0,0 +1,26 @@
1
+ // Ported from expo-notifications @ sdk-57's getBadgeCountAsync.ts / setBadgeCountAsync.ts.
2
+ //
3
+ // ponytail: upstream's `SetBadgeCountOptions.web` (a `badgin` options bag) is web-only and this
4
+ // project targets iOS/Android — not ported.
5
+ import { UnavailabilityError } from 'expo-modules-core';
6
+
7
+ import { badgeModule } from './native-modules';
8
+
9
+ /** Current app-icon badge count. `0` if unset — not every Android launcher supports badges. */
10
+ export async function getBadgeCountAsync(): Promise<number> {
11
+ if (!badgeModule.getBadgeCountAsync) {
12
+ throw new UnavailabilityError('Notifications', 'getBadgeCountAsync');
13
+ }
14
+ return badgeModule.getBadgeCountAsync();
15
+ }
16
+
17
+ /**
18
+ * Sets the app-icon badge. `0` clears it. On iOS this needs the `allowBadge` permission
19
+ * (`requestPermissionsAsync`) or it resolves to `false`.
20
+ */
21
+ export async function setBadgeCountAsync(badgeCount: number): Promise<boolean> {
22
+ if (!badgeModule.setBadgeCountAsync) {
23
+ throw new UnavailabilityError('Notifications', 'setBadgeCountAsync');
24
+ }
25
+ return badgeModule.setBadgeCountAsync(badgeCount);
26
+ }
@@ -0,0 +1,60 @@
1
+ // Ported from expo-notifications @ sdk-57's getNotificationCategoriesAsync.ts,
2
+ // setNotificationCategoryAsync.ts, deleteNotificationCategoryAsync.ts.
3
+ import { UnavailabilityError } from 'expo-modules-core';
4
+
5
+ import { notificationCategoriesModule } from './native-modules';
6
+ import type {
7
+ INotificationAction,
8
+ INotificationCategory,
9
+ INotificationCategoryOptions,
10
+ } from './types';
11
+
12
+ /** Every registered notification category. */
13
+ export async function getNotificationCategoriesAsync(): Promise<
14
+ INotificationCategory[]
15
+ > {
16
+ if (!notificationCategoriesModule.getNotificationCategoriesAsync) {
17
+ throw new UnavailabilityError(
18
+ 'Notifications',
19
+ 'getNotificationCategoriesAsync',
20
+ );
21
+ }
22
+ return notificationCategoriesModule.getNotificationCategoriesAsync();
23
+ }
24
+
25
+ /**
26
+ * Registers a category of action buttons under `identifier`, referenced later via
27
+ * `INotificationContentInput.categoryIdentifier`. Avoid `:`/`-` in `identifier`.
28
+ */
29
+ export async function setNotificationCategoryAsync(
30
+ identifier: string,
31
+ actions: INotificationAction[],
32
+ options?: INotificationCategoryOptions,
33
+ ): Promise<INotificationCategory> {
34
+ if (!notificationCategoriesModule.setNotificationCategoryAsync) {
35
+ throw new UnavailabilityError(
36
+ 'Notifications',
37
+ 'setNotificationCategoryAsync',
38
+ );
39
+ }
40
+ return notificationCategoriesModule.setNotificationCategoryAsync(
41
+ identifier,
42
+ actions,
43
+ options,
44
+ );
45
+ }
46
+
47
+ /** Deletes a category. Resolves `false` if it did not exist. */
48
+ export async function deleteNotificationCategoryAsync(
49
+ identifier: string,
50
+ ): Promise<boolean> {
51
+ if (!notificationCategoriesModule.deleteNotificationCategoryAsync) {
52
+ throw new UnavailabilityError(
53
+ 'Notifications',
54
+ 'deleteNotificationCategoryAsync',
55
+ );
56
+ }
57
+ return notificationCategoriesModule.deleteNotificationCategoryAsync(
58
+ identifier,
59
+ );
60
+ }