Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: patch notifee to support monthly recurring reminders.

ammarahm-edc6297227bfc2
diff --git a/apps/mobile/patches/@notifee+react-native+7.1.0.patch b/apps/mobile/patches/@notifee+react-native+7.1.0.patch
new file mode 100644
index 000000000..281c76a74
--- /dev/null
+++ b/apps/mobile/patches/@notifee+react-native+7.1.0.patch
@@ -0,0 +1,55 @@
+diff --git a/node_modules/@notifee/react-native/dist/types/Trigger.d.ts b/node_modules/@notifee/react-native/dist/types/Trigger.d.ts
+index 9907278..89d2116 100644
+--- a/node_modules/@notifee/react-native/dist/types/Trigger.d.ts
++++ b/node_modules/@notifee/react-native/dist/types/Trigger.d.ts
+@@ -55,7 +55,8 @@ export declare enum RepeatFrequency {
+ NONE = -1,
+ HOURLY = 0,
+ DAILY = 1,
+- WEEKLY = 2
++ WEEKLY = 2,
++ MONTHLY = 3
+ }
+ /**
+ * Interface for building a trigger that repeats at a specified interval.
+diff --git a/node_modules/@notifee/react-native/ios/NotifeeCore/NotifeeCoreUtil.h b/node_modules/@notifee/react-native/ios/NotifeeCore/NotifeeCoreUtil.h
+index 9ae89e3..ecc7afa 100644
+--- a/node_modules/@notifee/react-native/ios/NotifeeCore/NotifeeCoreUtil.h
++++ b/node_modules/@notifee/react-native/ios/NotifeeCore/NotifeeCoreUtil.h
+@@ -41,7 +41,8 @@ typedef NS_ENUM(NSInteger, NotifeeCoreTriggerType) {
+ typedef NS_ENUM(NSInteger, NotifeeCoreRepeatFrequency) {
+ NotifeeCoreRepeatFrequencyHourly = 0,
+ NotifeeCoreRepeatFrequencyDaily = 1,
+- NotifeeCoreRepeatFrequencyWeekly = 2
++ NotifeeCoreRepeatFrequencyWeekly = 2,
++ NotifeeCoreRepeatFrequencyMonthly = 3
+ };
+
+ @interface NotifeeCoreUtil : NSObject
+diff --git a/node_modules/@notifee/react-native/ios/NotifeeCore/NotifeeCoreUtil.m b/node_modules/@notifee/react-native/ios/NotifeeCore/NotifeeCoreUtil.m
+index e489445..71b360e 100644
+--- a/node_modules/@notifee/react-native/ios/NotifeeCore/NotifeeCoreUtil.m
++++ b/node_modules/@notifee/react-native/ios/NotifeeCore/NotifeeCoreUtil.m
+@@ -337,6 +337,10 @@ + (UNNotificationTrigger *)timestampTriggerFromDictionary:(NSDictionary *)trigge
+ // match by day, hour, minute, and second
+ calendarUnit =
+ NSCalendarUnitWeekday | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond;
++ } else if (repeatFrequency == NotifeeCoreRepeatFrequencyMonthly) {
++ // match by day, hour, minute, and second
++ calendarUnit =
++ NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond;
+ } else {
+ NSLog(@"NotifeeCore: Failed to parse TimestampTrigger with unknown "
+ @"repeatFrequency: %ld",
+diff --git a/node_modules/@notifee/react-native/src/types/Trigger.ts b/node_modules/@notifee/react-native/src/types/Trigger.ts
+index 6c0760a..5ad765b 100644
+--- a/node_modules/@notifee/react-native/src/types/Trigger.ts
++++ b/node_modules/@notifee/react-native/src/types/Trigger.ts
+@@ -60,6 +60,7 @@ export enum RepeatFrequency {
+ HOURLY = 0,
+ DAILY = 1,
+ WEEKLY = 2,
++ MONTHLY = 3
+ }
+
+ /**