From 544f7befe0f7d3e61fb03365ec588a2ab3c5a17a Mon Sep 17 00:00:00 2001 From: hailey Date: Fri, 2 May 2025 13:23:39 -0700 Subject: bump it bop it upgrade it (rn 79/expo 53) (#8281) * basic bumps * more tweaking * fix rn patch * fix crop picker patch * fix media library patch * rm unnecessary patch * fix notifications patch * update bottomsheet * Update withAppDelegateReferrer.js * Delete withNoBundleCompression.js * rm withNoBundleCompression plugin * rm findLast shim * metro package exports is enabled by default * update react/react-dom/react-compiler * fix reanimated issue * vendor expo-ized emoji popup * fix types * hackfix view full thread * Update EmojiPickerModule.podspec * more upgrades * fix multiformats package version * add baseurl * bump mmkv * bumps * update react-keyed-flatten-children * bump locale packages * fix emoji picker dark mode * rn upgrades * Revert "bump locale packages" This reverts commit fc82f0f173032127dd7c18ed0316ae26f53db51d. * upgrade testing-library * rm test renderer * update patch name minors * rm findNodeHandle from tabbar * only do scrollview tag thing on ios * disable package exports * update expo notifications handler * memoize emoji picker styles * fix tests, mock multiformats * bump some dev deps with RC versions * completely rearchitect toasts * rm logs * layout animation config for composer footer * disable autolinking for patched libs * undo lingui changes * version bump from release candidate to 0.1 * update atproto deps * rm @did-plc/server * fix key issue (maybe) * move URL polyfill to the polyfill file * fix yarn lock * upgrade to 53.0.3 * reanimated layout anim bug patch * workletize a function that wasn't getting autoworkletized anymore (#8309) * bump to expo 53.0.4 * bump RN to 0.79.2 * fix yarn lock ci * Revert "completely rearchitect toasts" This reverts commit 2e2fcaeeed527580a6c485718544b85e8b4f52b9. * final upgrades * chore: cleanup yarn lock * prettier --------- Co-authored-by: Samuel Newman --- patches/expo-haptics+14.0.0.md | 11 - patches/expo-haptics+14.0.1.patch | 13 - patches/expo-haptics+14.1.4.patch | 13 + patches/expo-haptics+14.1.4.patch.md | 11 + patches/expo-image-manipulator+13.0.6.patch | 101 --- patches/expo-media-library+17.0.6.patch | 19 - patches/expo-media-library+17.1.6.patch | 19 + patches/expo-modules-core+2.1.2.md | 3 - patches/expo-modules-core+2.2.3.patch | 15 - patches/expo-modules-core+2.3.12.patch | 15 + patches/expo-modules-core+2.3.12.patch.md | 3 + patches/expo-notifications+0.29.11.patch.md | 14 - patches/expo-notifications+0.29.14.patch | 169 ---- patches/expo-notifications+0.31.1.patch | 992 +++++++++++++++++++++ patches/expo-notifications+0.31.1.patch.md | 14 + patches/expo-updates+0.26.10.patch.md | 7 - patches/expo-updates+0.27.4.patch | 26 - patches/expo-updates+0.28.12.patch | 26 + patches/expo-updates+0.28.12.patch.md | 7 + patches/react-native+0.76.6.patch.md | 17 - patches/react-native+0.76.9.patch | 366 -------- patches/react-native+0.79.2.patch | 119 +++ patches/react-native+0.79.2.patch.md | 13 + patches/react-native-gesture-handler+2.20.2.patch | 36 - patches/react-native-gesture-handler+2.25.0.patch | 36 + .../react-native-image-crop-picker+0.41.6.patch | 47 - .../react-native-image-crop-picker+0.42.0.patch | 48 + patches/react-native-reanimated+3.17.5.patch | 44 + patches/react-native-svg+15.11.2.patch | 57 ++ patches/react-native-svg+15.8.0.patch | 57 -- 30 files changed, 1417 insertions(+), 901 deletions(-) delete mode 100644 patches/expo-haptics+14.0.0.md delete mode 100644 patches/expo-haptics+14.0.1.patch create mode 100644 patches/expo-haptics+14.1.4.patch create mode 100644 patches/expo-haptics+14.1.4.patch.md delete mode 100644 patches/expo-image-manipulator+13.0.6.patch delete mode 100644 patches/expo-media-library+17.0.6.patch create mode 100644 patches/expo-media-library+17.1.6.patch delete mode 100644 patches/expo-modules-core+2.1.2.md delete mode 100644 patches/expo-modules-core+2.2.3.patch create mode 100644 patches/expo-modules-core+2.3.12.patch create mode 100644 patches/expo-modules-core+2.3.12.patch.md delete mode 100644 patches/expo-notifications+0.29.11.patch.md delete mode 100644 patches/expo-notifications+0.29.14.patch create mode 100644 patches/expo-notifications+0.31.1.patch create mode 100644 patches/expo-notifications+0.31.1.patch.md delete mode 100644 patches/expo-updates+0.26.10.patch.md delete mode 100644 patches/expo-updates+0.27.4.patch create mode 100644 patches/expo-updates+0.28.12.patch create mode 100644 patches/expo-updates+0.28.12.patch.md delete mode 100644 patches/react-native+0.76.6.patch.md delete mode 100644 patches/react-native+0.76.9.patch create mode 100644 patches/react-native+0.79.2.patch create mode 100644 patches/react-native+0.79.2.patch.md delete mode 100644 patches/react-native-gesture-handler+2.20.2.patch create mode 100644 patches/react-native-gesture-handler+2.25.0.patch delete mode 100644 patches/react-native-image-crop-picker+0.41.6.patch create mode 100644 patches/react-native-image-crop-picker+0.42.0.patch create mode 100644 patches/react-native-reanimated+3.17.5.patch create mode 100644 patches/react-native-svg+15.11.2.patch delete mode 100644 patches/react-native-svg+15.8.0.patch (limited to 'patches') diff --git a/patches/expo-haptics+14.0.0.md b/patches/expo-haptics+14.0.0.md deleted file mode 100644 index afa7395bc..000000000 --- a/patches/expo-haptics+14.0.0.md +++ /dev/null @@ -1,11 +0,0 @@ -# Expo Haptics Patch - -Whenever we migrated to Expo Haptics, there was a difference between how the previous and new libraries handled the -Android implementation of an iOS "light" haptic. The previous library used the `Vibration` API solely, which does not -have any configuration for intensity of vibration. The `Vibration` API has also been deprecated since SDK 26. See: -https://github.com/mkuczera/react-native-haptic-feedback/blob/master/android/src/main/java/com/mkuczera/vibrateFactory/VibrateWithDuration.java - -Expo Haptics is using `VibrationManager` API on SDK >= 31. See: https://github.com/expo/expo/blob/main/packages/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt#L19 -The timing and intensity of their haptic configurations though differs greatly from the original implementation. This -patch uses the new `VibrationManager` API to create the same vibration that would have been seen in the deprecated -`Vibration` API. diff --git a/patches/expo-haptics+14.0.1.patch b/patches/expo-haptics+14.0.1.patch deleted file mode 100644 index 9c7b9a666..000000000 --- a/patches/expo-haptics+14.0.1.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt b/node_modules/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt -index 1520465..6ea988a 100644 ---- a/node_modules/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt -+++ b/node_modules/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt -@@ -42,7 +42,7 @@ class HapticsModule : Module() { - - private fun vibrate(type: HapticsVibrationType) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { -- vibrator.vibrate(VibrationEffect.createWaveform(type.timings, type.amplitudes, -1)) -+ vibrator.vibrate(VibrationEffect.createWaveform(type.oldSDKPattern, intArrayOf(0, 100), -1)) - } else { - @Suppress("DEPRECATION") - vibrator.vibrate(type.oldSDKPattern, -1) diff --git a/patches/expo-haptics+14.1.4.patch b/patches/expo-haptics+14.1.4.patch new file mode 100644 index 000000000..9c7b9a666 --- /dev/null +++ b/patches/expo-haptics+14.1.4.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt b/node_modules/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt +index 1520465..6ea988a 100644 +--- a/node_modules/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt ++++ b/node_modules/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt +@@ -42,7 +42,7 @@ class HapticsModule : Module() { + + private fun vibrate(type: HapticsVibrationType) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { +- vibrator.vibrate(VibrationEffect.createWaveform(type.timings, type.amplitudes, -1)) ++ vibrator.vibrate(VibrationEffect.createWaveform(type.oldSDKPattern, intArrayOf(0, 100), -1)) + } else { + @Suppress("DEPRECATION") + vibrator.vibrate(type.oldSDKPattern, -1) diff --git a/patches/expo-haptics+14.1.4.patch.md b/patches/expo-haptics+14.1.4.patch.md new file mode 100644 index 000000000..afa7395bc --- /dev/null +++ b/patches/expo-haptics+14.1.4.patch.md @@ -0,0 +1,11 @@ +# Expo Haptics Patch + +Whenever we migrated to Expo Haptics, there was a difference between how the previous and new libraries handled the +Android implementation of an iOS "light" haptic. The previous library used the `Vibration` API solely, which does not +have any configuration for intensity of vibration. The `Vibration` API has also been deprecated since SDK 26. See: +https://github.com/mkuczera/react-native-haptic-feedback/blob/master/android/src/main/java/com/mkuczera/vibrateFactory/VibrateWithDuration.java + +Expo Haptics is using `VibrationManager` API on SDK >= 31. See: https://github.com/expo/expo/blob/main/packages/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt#L19 +The timing and intensity of their haptic configurations though differs greatly from the original implementation. This +patch uses the new `VibrationManager` API to create the same vibration that would have been seen in the deprecated +`Vibration` API. diff --git a/patches/expo-image-manipulator+13.0.6.patch b/patches/expo-image-manipulator+13.0.6.patch deleted file mode 100644 index 02d4d5fb9..000000000 --- a/patches/expo-image-manipulator+13.0.6.patch +++ /dev/null @@ -1,101 +0,0 @@ -diff --git a/node_modules/expo-image-manipulator/src/ImageManipulator.web.ts b/node_modules/expo-image-manipulator/src/ImageManipulator.web.ts -new file mode 100644 -index 0000000..babbb3b ---- /dev/null -+++ b/node_modules/expo-image-manipulator/src/ImageManipulator.web.ts -@@ -0,0 +1,60 @@ -+import { useReleasingSharedObject } from 'expo-modules-core'; -+import { SharedRef } from 'expo-modules-core/types'; -+ -+import { Action, ImageResult, SaveFormat, SaveOptions } from './ImageManipulator.types'; -+import { ImageManipulatorContext } from './ImageManipulatorContext'; -+import ExpoImageManipulator from './NativeImageManipulatorModule'; -+import { validateArguments } from './validators'; -+ -+// @needsAudit -+/** -+ * Manipulate the image provided via `uri`. Available modifications are rotating, flipping (mirroring), -+ * resizing and cropping. Each invocation results in a new file. With one invocation you can provide -+ * a set of actions to perform over the image. Overwriting the source file would not have an effect -+ * in displaying the result as images are cached. -+ * @param uri URI of the file to manipulate. Should be on the local file system or a base64 data URI. -+ * @param actions An array of objects representing manipulation options. Each object should have -+ * __only one__ of the keys that corresponds to specific transformation. -+ * @param saveOptions A map defining how modified image should be saved. -+ * @return Promise which fulfils with [`ImageResult`](#imageresult) object. -+ * @deprecated It has been replaced by the new, contextual and object-oriented API. -+ * Use [`ImageManipulator.manipulate`](#manipulateuri) or [`useImageManipulator`](#useimagemanipulatoruri) instead. -+ */ -+export async function manipulateAsync( -+ uri: string, -+ actions: Action[] = [], -+ saveOptions: SaveOptions = {} -+): Promise { -+ validateArguments(uri, actions, saveOptions); -+ -+ const { format = SaveFormat.JPEG, ...rest } = saveOptions; -+ const context = ExpoImageManipulator.manipulate(uri); -+ -+ for (const action of actions) { -+ if ('resize' in action) { -+ context.resize(action.resize); -+ } else if ('rotate' in action) { -+ context.rotate(action.rotate); -+ } else if ('flip' in action) { -+ context.flip(action.flip); -+ } else if ('crop' in action) { -+ context.crop(action.crop); -+ } else if ('extent' in action && context.extent) { -+ context.extent(action.extent); -+ } -+ } -+ const image = await context.renderAsync(saveOptions.compress); -+ const result = await image.saveAsync({ format, ...rest }); -+ -+ // These shared objects will not be used anymore, so free up some memory. -+ context.release(); -+ image.release(); -+ -+ return result; -+} -+ -+export function useImageManipulator(source: string | SharedRef<'image'>): ImageManipulatorContext { -+ return useReleasingSharedObject(() => ExpoImageManipulator.manipulate(source), [source]); -+} -+ -+export { ExpoImageManipulator as ImageManipulator }; -diff --git a/node_modules/expo-image-manipulator/src/ImageManipulatorContext.ts b/node_modules/expo-image-manipulator/src/ImageManipulatorContext.ts -index 120d8d3..f8aa49c 100644 ---- a/node_modules/expo-image-manipulator/src/ImageManipulatorContext.ts -+++ b/node_modules/expo-image-manipulator/src/ImageManipulatorContext.ts -@@ -52,7 +52,7 @@ export declare class ImageManipulatorContext extends SharedObject { - /** - * Awaits for all manipulation tasks to finish and resolves with a reference to the resulted native image. - */ -- renderAsync(): Promise; -+ renderAsync(compress?: number): Promise; - } - - export default ExpoImageManipulator.Context as typeof ImageManipulatorContext; -diff --git a/node_modules/expo-image-manipulator/src/web/ImageManipulatorContext.web.ts b/node_modules/expo-image-manipulator/src/web/ImageManipulatorContext.web.ts -index 428848c..363a57a 100644 ---- a/node_modules/expo-image-manipulator/src/web/ImageManipulatorContext.web.ts -+++ b/node_modules/expo-image-manipulator/src/web/ImageManipulatorContext.web.ts -@@ -41,7 +41,7 @@ export default class ImageManipulatorContext extends SharedObject { - return this; - } - -- async renderAsync(): Promise { -+ async renderAsync(compress?: number): Promise { - const canvas = await this.currentTask; - - return new Promise((resolve) => { -@@ -49,7 +49,7 @@ export default class ImageManipulatorContext extends SharedObject { - const url = blob ? URL.createObjectURL(blob) : canvas.toDataURL(); - - resolve(new ImageManipulatorImageRef(url, canvas.width, canvas.height)); -- }); -+ }, typeof compress === 'number' ? 'image/jpeg' : undefined, compress); - }); - } - diff --git a/patches/expo-media-library+17.0.6.patch b/patches/expo-media-library+17.0.6.patch deleted file mode 100644 index 7ef57f768..000000000 --- a/patches/expo-media-library+17.0.6.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryModule.kt b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryModule.kt -index 64e6efe..e61485e 100644 ---- a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryModule.kt -+++ b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryModule.kt -@@ -111,12 +111,12 @@ class MediaLibraryModule : Module() { - } - - AsyncFunction("createAssetAsync") { localUri: String, promise: Promise -> -- throwUnlessPermissionsGranted { -+ //throwUnlessPermissionsGranted { - withModuleScope(promise) { - CreateAsset(context, localUri, promise) - .execute() - } -- } -+ //} - } - - AsyncFunction("addAssetsToAlbumAsync") { assetsId: List, albumId: String, copyToAlbum: Boolean, promise: Promise -> diff --git a/patches/expo-media-library+17.1.6.patch b/patches/expo-media-library+17.1.6.patch new file mode 100644 index 000000000..4fa853ec3 --- /dev/null +++ b/patches/expo-media-library+17.1.6.patch @@ -0,0 +1,19 @@ +diff --git a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryModule.kt b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryModule.kt +index f1255e8..a9b49e5 100644 +--- a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryModule.kt ++++ b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryModule.kt +@@ -112,11 +112,9 @@ class MediaLibraryModule : Module() { + } + + AsyncFunction("createAssetAsync") { localUri: String, albumId: String?, promise: Promise -> +- throwUnlessPermissionsGranted { +- withModuleScope(promise) { +- CreateAssetWithAlbumId(context, localUri, promise, true, albumId) +- .execute() +- } ++ withModuleScope(promise) { ++ CreateAssetWithAlbumId(context, localUri, promise, true, albumId) ++ .execute() + } + } + diff --git a/patches/expo-modules-core+2.1.2.md b/patches/expo-modules-core+2.1.2.md deleted file mode 100644 index a71324c19..000000000 --- a/patches/expo-modules-core+2.1.2.md +++ /dev/null @@ -1,3 +0,0 @@ -## expo-modules-core Patch - -This patch fixes an issue where bitdrift's API stream gets blocked by the Expo interceptor used to power the devtools diff --git a/patches/expo-modules-core+2.2.3.patch b/patches/expo-modules-core+2.2.3.patch deleted file mode 100644 index f3d9bfd14..000000000 --- a/patches/expo-modules-core+2.2.3.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/devtools/ExpoNetworkInspectOkHttpInterceptors.kt b/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/devtools/ExpoNetworkInspectOkHttpInterceptors.kt -index 47c4d15..afe138d 100644 ---- a/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/devtools/ExpoNetworkInspectOkHttpInterceptors.kt -+++ b/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/devtools/ExpoNetworkInspectOkHttpInterceptors.kt -@@ -125,6 +125,10 @@ internal fun peekResponseBody( - } - - internal fun shouldParseBody(response: Response): Boolean { -+ if (response.request.url.encodedPath == "/bitdrift_public.protobuf.client.v1.ApiService/Mux") { -+ return false -+ } -+ - // Check for Content-Type - val skipContentTypes = listOf( - "text/event-stream", // Server Sent Events diff --git a/patches/expo-modules-core+2.3.12.patch b/patches/expo-modules-core+2.3.12.patch new file mode 100644 index 000000000..f3d9bfd14 --- /dev/null +++ b/patches/expo-modules-core+2.3.12.patch @@ -0,0 +1,15 @@ +diff --git a/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/devtools/ExpoNetworkInspectOkHttpInterceptors.kt b/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/devtools/ExpoNetworkInspectOkHttpInterceptors.kt +index 47c4d15..afe138d 100644 +--- a/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/devtools/ExpoNetworkInspectOkHttpInterceptors.kt ++++ b/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/devtools/ExpoNetworkInspectOkHttpInterceptors.kt +@@ -125,6 +125,10 @@ internal fun peekResponseBody( + } + + internal fun shouldParseBody(response: Response): Boolean { ++ if (response.request.url.encodedPath == "/bitdrift_public.protobuf.client.v1.ApiService/Mux") { ++ return false ++ } ++ + // Check for Content-Type + val skipContentTypes = listOf( + "text/event-stream", // Server Sent Events diff --git a/patches/expo-modules-core+2.3.12.patch.md b/patches/expo-modules-core+2.3.12.patch.md new file mode 100644 index 000000000..a71324c19 --- /dev/null +++ b/patches/expo-modules-core+2.3.12.patch.md @@ -0,0 +1,3 @@ +## expo-modules-core Patch + +This patch fixes an issue where bitdrift's API stream gets blocked by the Expo interceptor used to power the devtools diff --git a/patches/expo-notifications+0.29.11.patch.md b/patches/expo-notifications+0.29.11.patch.md deleted file mode 100644 index 05f841725..000000000 --- a/patches/expo-notifications+0.29.11.patch.md +++ /dev/null @@ -1,14 +0,0 @@ -## LOAD BEARING PATCH, DO NOT REMOVE - -## Expo-Notifications Patch - -This patch supports the Android background notification handling module. Incoming messages -in `onMessageReceived` are sent to the module for handling. - -It also allows us to set the Android notification channel ID from the notification `data`, rather -than the `notification` object in the payload. - -### `setBadgeCountAsync` fix on Android - -`ShortcutBadger`'s `setCount` doesn't work for clearing the badge on Android for some reason. Instead, let's use the -Android API for clearing the badge. diff --git a/patches/expo-notifications+0.29.14.patch b/patches/expo-notifications+0.29.14.patch deleted file mode 100644 index dd70cc781..000000000 --- a/patches/expo-notifications+0.29.14.patch +++ /dev/null @@ -1,169 +0,0 @@ -diff --git a/node_modules/expo-notifications/android/build.gradle b/node_modules/expo-notifications/android/build.gradle -index 13bffbb..5ebbede 100644 ---- a/node_modules/expo-notifications/android/build.gradle -+++ b/node_modules/expo-notifications/android/build.gradle -@@ -46,6 +46,7 @@ dependencies { - implementation 'com.google.firebase:firebase-messaging:24.0.1' - - implementation 'me.leolin:ShortcutBadger:1.1.22@aar' -+ implementation project(':expo-background-notification-handler') - - if (project.findProject(':expo-modules-test-core')) { - testImplementation project(':expo-modules-test-core') -diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/interfaces/INotificationContent.kt b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/interfaces/INotificationContent.kt -index 7b99e6c..45a450d 100644 ---- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/interfaces/INotificationContent.kt -+++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/interfaces/INotificationContent.kt -@@ -15,6 +15,7 @@ import org.json.JSONObject - * This interface exists to provide a common API for both classes. - * */ - interface INotificationContent : Parcelable { -+ val channelId: String? - val title: String? - val text: String? - val subText: String? -diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java -index 191b64e..fe8b3c5 100644 ---- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java -+++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java -@@ -35,6 +35,7 @@ import kotlin.coroutines.Continuation; - * Refactoring this class may require a migration strategy for the data stored in SharedPreferences. - */ - public class NotificationContent implements Parcelable, Serializable, INotificationContent { -+ private String mChannelId; - private String mTitle; - private String mText; - private String mSubtitle; -@@ -65,6 +66,11 @@ public class NotificationContent implements Parcelable, Serializable, INotificat - } - }; - -+ @Nullable -+ public String getChannelId() { -+ return mChannelId; -+ } -+ - @Nullable - public String getTitle() { - return mTitle; -@@ -158,6 +164,7 @@ public class NotificationContent implements Parcelable, Serializable, INotificat - } - - protected NotificationContent(Parcel in) { -+ mChannelId = in.readString(); - mTitle = in.readString(); - mText = in.readString(); - mSubtitle = in.readString(); -@@ -183,6 +190,7 @@ public class NotificationContent implements Parcelable, Serializable, INotificat - - @Override - public void writeToParcel(Parcel dest, int flags) { -+ dest.writeString(mChannelId); - dest.writeString(mTitle); - dest.writeString(mText); - dest.writeString(mSubtitle); -@@ -203,6 +211,7 @@ public class NotificationContent implements Parcelable, Serializable, INotificat - private static final long serialVersionUID = 397666843266836802L; - - private void writeObject(java.io.ObjectOutputStream out) throws IOException { -+ out.writeObject(mChannelId); - out.writeObject(mTitle); - out.writeObject(mText); - out.writeObject(mSubtitle); -@@ -285,6 +294,11 @@ public class NotificationContent implements Parcelable, Serializable, INotificat - useDefaultVibrationPattern(); - } - -+ public Builder setChannelId(String channelId) { -+ content.mChannelId = channelId; -+ return this; -+ } -+ - public Builder setTitle(String title) { - content.mTitle = title; - return this; -diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationData.kt b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationData.kt -index 39b5aad..e50797d 100644 ---- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationData.kt -+++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationData.kt -@@ -11,6 +11,9 @@ import org.json.JSONObject - * */ - @JvmInline - value class NotificationData(private val data: Map) { -+ val channelId: String? -+ get() = data["channelId"] -+ - val title: String? - get() = data["title"] - -diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/RemoteNotificationContent.kt b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/RemoteNotificationContent.kt -index d2cc6cf..6a48ff2 100644 ---- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/RemoteNotificationContent.kt -+++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/RemoteNotificationContent.kt -@@ -31,6 +31,8 @@ class RemoteNotificationContent(private val remoteMessage: RemoteMessage) : INot - return remoteMessage.notification?.imageUrl != null - } - -+ override val channelId = remoteMessage.notification?.channelId ?: notificationData.channelId -+ - override val title = remoteMessage.notification?.title ?: notificationData.title - - override val text = remoteMessage.notification?.body ?: notificationData.message -diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.kt b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.kt -index 8ca6ec5..57c3599 100644 ---- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.kt -+++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.kt -@@ -101,6 +101,9 @@ open class ExpoNotificationBuilder( - builder.setOngoing(content.isSticky) - - // see "Notification anatomy" https://developer.android.com/develop/ui/views/notifications#Templates -+ content.channelId?.let { -+ builder.setChannelId(it) -+ } - builder.setContentTitle(content.title) - builder.setContentText(content.text) - builder.setSubText(content.subText) -diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt -index 9f22441..5f92f80 100644 ---- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt -+++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt -@@ -2,6 +2,9 @@ package expo.modules.notifications.service.delegates - - import android.content.Context - import com.google.firebase.messaging.RemoteMessage -+import expo.modules.backgroundnotificationhandler.BackgroundNotificationHandler -+import expo.modules.backgroundnotificationhandler.BackgroundNotificationHandlerInterface -+import expo.modules.backgroundnotificationhandler.ExpoBackgroundNotificationHandlerModule - import expo.modules.interfaces.taskManager.TaskServiceProviderHelper - import expo.modules.notifications.notifications.RemoteMessageSerializer - import expo.modules.notifications.notifications.background.BackgroundRemoteNotificationTaskConsumer -@@ -17,7 +20,8 @@ import expo.modules.notifications.tokens.interfaces.FirebaseTokenListener - import java.lang.ref.WeakReference - import java.util.* - --open class FirebaseMessagingDelegate(protected val context: Context) : FirebaseMessagingDelegate { -+open class FirebaseMessagingDelegate(protected val context: Context) : FirebaseMessagingDelegate, -+ BackgroundNotificationHandlerInterface { - companion object { - // Unfortunately we cannot save state between instances of a service other way - // than by static properties. Fortunately, using weak references we can -@@ -94,8 +98,17 @@ open class FirebaseMessagingDelegate(protected val context: Context) : FirebaseM - DebugLogging.logRemoteMessage("FirebaseMessagingDelegate.onMessageReceived: message", remoteMessage) - val notification = createNotification(remoteMessage) - DebugLogging.logNotification("FirebaseMessagingDelegate.onMessageReceived: notification", notification) -- NotificationsService.receive(context, notification) -- runTaskManagerTasks(remoteMessage) -+ -+ if (!ExpoBackgroundNotificationHandlerModule.isForegrounded) { -+ BackgroundNotificationHandler(context, this).handleMessage(remoteMessage) -+ } else { -+ showMessage(remoteMessage) -+ runTaskManagerTasks(remoteMessage) -+ } -+ } -+ -+ override fun showMessage(remoteMessage: RemoteMessage) { -+ NotificationsService.receive(context, createNotification(remoteMessage)) - } - - private fun runTaskManagerTasks(remoteMessage: RemoteMessage) { diff --git a/patches/expo-notifications+0.31.1.patch b/patches/expo-notifications+0.31.1.patch new file mode 100644 index 000000000..56e639a26 --- /dev/null +++ b/patches/expo-notifications+0.31.1.patch @@ -0,0 +1,992 @@ +diff --git a/node_modules/expo-notifications/android/.gradle/8.10/checksums/checksums.lock b/node_modules/expo-notifications/android/.gradle/8.10/checksums/checksums.lock +new file mode 100644 +index 0000000..883ef6a +Binary files /dev/null and b/node_modules/expo-notifications/android/.gradle/8.10/checksums/checksums.lock differ +diff --git a/node_modules/expo-notifications/android/.gradle/8.10/dependencies-accessors/gc.properties b/node_modules/expo-notifications/android/.gradle/8.10/dependencies-accessors/gc.properties +new file mode 100644 +index 0000000..e69de29 +diff --git a/node_modules/expo-notifications/android/.gradle/8.10/fileChanges/last-build.bin b/node_modules/expo-notifications/android/.gradle/8.10/fileChanges/last-build.bin +new file mode 100644 +index 0000000..f76dd23 +Binary files /dev/null and b/node_modules/expo-notifications/android/.gradle/8.10/fileChanges/last-build.bin differ +diff --git a/node_modules/expo-notifications/android/.gradle/8.10/fileHashes/fileHashes.lock b/node_modules/expo-notifications/android/.gradle/8.10/fileHashes/fileHashes.lock +new file mode 100644 +index 0000000..774caf7 +Binary files /dev/null and b/node_modules/expo-notifications/android/.gradle/8.10/fileHashes/fileHashes.lock differ +diff --git a/node_modules/expo-notifications/android/.gradle/8.10/gc.properties b/node_modules/expo-notifications/android/.gradle/8.10/gc.properties +new file mode 100644 +index 0000000..e69de29 +diff --git a/node_modules/expo-notifications/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/node_modules/expo-notifications/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +new file mode 100644 +index 0000000..a3c1514 +Binary files /dev/null and b/node_modules/expo-notifications/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ +diff --git a/node_modules/expo-notifications/android/.gradle/buildOutputCleanup/cache.properties b/node_modules/expo-notifications/android/.gradle/buildOutputCleanup/cache.properties +new file mode 100644 +index 0000000..0e5b4da +--- /dev/null ++++ b/node_modules/expo-notifications/android/.gradle/buildOutputCleanup/cache.properties +@@ -0,0 +1,2 @@ ++#Thu Apr 24 20:44:36 PDT 2025 ++gradle.version=8.10 +diff --git a/node_modules/expo-notifications/android/.gradle/config.properties b/node_modules/expo-notifications/android/.gradle/config.properties +new file mode 100644 +index 0000000..0bd71c6 +--- /dev/null ++++ b/node_modules/expo-notifications/android/.gradle/config.properties +@@ -0,0 +1,2 @@ ++#Thu Apr 24 20:44:32 PDT 2025 ++java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home +diff --git a/node_modules/expo-notifications/android/.gradle/vcs-1/gc.properties b/node_modules/expo-notifications/android/.gradle/vcs-1/gc.properties +new file mode 100644 +index 0000000..e69de29 +diff --git a/node_modules/expo-notifications/android/.idea/.gitignore b/node_modules/expo-notifications/android/.idea/.gitignore +new file mode 100644 +index 0000000..26d3352 +--- /dev/null ++++ b/node_modules/expo-notifications/android/.idea/.gitignore +@@ -0,0 +1,3 @@ ++# Default ignored files ++/shelf/ ++/workspace.xml +diff --git a/node_modules/expo-notifications/android/.idea/AndroidProjectSystem.xml b/node_modules/expo-notifications/android/.idea/AndroidProjectSystem.xml +new file mode 100644 +index 0000000..4a53bee +--- /dev/null ++++ b/node_modules/expo-notifications/android/.idea/AndroidProjectSystem.xml +@@ -0,0 +1,6 @@ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/node_modules/expo-notifications/android/.idea/caches/deviceStreaming.xml b/node_modules/expo-notifications/android/.idea/caches/deviceStreaming.xml +new file mode 100644 +index 0000000..9e9ba09 +--- /dev/null ++++ b/node_modules/expo-notifications/android/.idea/caches/deviceStreaming.xml +@@ -0,0 +1,607 @@ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/node_modules/expo-notifications/android/.idea/gradle.xml b/node_modules/expo-notifications/android/.idea/gradle.xml +new file mode 100644 +index 0000000..b838237 +--- /dev/null ++++ b/node_modules/expo-notifications/android/.idea/gradle.xml +@@ -0,0 +1,12 @@ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/node_modules/expo-notifications/android/.idea/migrations.xml b/node_modules/expo-notifications/android/.idea/migrations.xml +new file mode 100644 +index 0000000..f8051a6 +--- /dev/null ++++ b/node_modules/expo-notifications/android/.idea/migrations.xml +@@ -0,0 +1,10 @@ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/node_modules/expo-notifications/android/.idea/misc.xml b/node_modules/expo-notifications/android/.idea/misc.xml +new file mode 100644 +index 0000000..3040d03 +--- /dev/null ++++ b/node_modules/expo-notifications/android/.idea/misc.xml +@@ -0,0 +1,10 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/node_modules/expo-notifications/android/.idea/runConfigurations.xml b/node_modules/expo-notifications/android/.idea/runConfigurations.xml +new file mode 100644 +index 0000000..16660f1 +--- /dev/null ++++ b/node_modules/expo-notifications/android/.idea/runConfigurations.xml +@@ -0,0 +1,17 @@ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/node_modules/expo-notifications/android/.idea/workspace.xml b/node_modules/expo-notifications/android/.idea/workspace.xml +new file mode 100644 +index 0000000..df26928 +--- /dev/null ++++ b/node_modules/expo-notifications/android/.idea/workspace.xml +@@ -0,0 +1,47 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ 1745552672693 ++ ++ ++ ++ +\ No newline at end of file +diff --git a/node_modules/expo-notifications/android/build.gradle b/node_modules/expo-notifications/android/build.gradle +index bc479ee..1ebfa00 100644 +--- a/node_modules/expo-notifications/android/build.gradle ++++ b/node_modules/expo-notifications/android/build.gradle +@@ -42,6 +42,7 @@ dependencies { + implementation 'com.google.firebase:firebase-messaging:24.0.1' + + implementation 'me.leolin:ShortcutBadger:1.1.22@aar' ++ implementation project(':expo-background-notification-handler') + + if (project.findProject(':expo-modules-test-core')) { + testImplementation project(':expo-modules-test-core') +diff --git a/node_modules/expo-notifications/android/local.properties b/node_modules/expo-notifications/android/local.properties +new file mode 100644 +index 0000000..ab4c86d +--- /dev/null ++++ b/node_modules/expo-notifications/android/local.properties +@@ -0,0 +1,8 @@ ++## This file must *NOT* be checked into Version Control Systems, ++# as it contains information specific to your local configuration. ++# ++# Location of the SDK. This is only used by Gradle. ++# For customization when using a Version Control System, please read the ++# header note. ++#Thu Apr 24 20:44:32 PDT 2025 ++sdk.dir=/Users/hailey/Library/Android/sdk +diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/interfaces/INotificationContent.kt b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/interfaces/INotificationContent.kt +index 7b99e6c..45a450d 100644 +--- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/interfaces/INotificationContent.kt ++++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/interfaces/INotificationContent.kt +@@ -15,6 +15,7 @@ import org.json.JSONObject + * This interface exists to provide a common API for both classes. + * */ + interface INotificationContent : Parcelable { ++ val channelId: String? + val title: String? + val text: String? + val subText: String? +diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java +index 191b64e..fe8b3c5 100644 +--- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java ++++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java +@@ -35,6 +35,7 @@ import kotlin.coroutines.Continuation; + * Refactoring this class may require a migration strategy for the data stored in SharedPreferences. + */ + public class NotificationContent implements Parcelable, Serializable, INotificationContent { ++ private String mChannelId; + private String mTitle; + private String mText; + private String mSubtitle; +@@ -65,6 +66,11 @@ public class NotificationContent implements Parcelable, Serializable, INotificat + } + }; + ++ @Nullable ++ public String getChannelId() { ++ return mChannelId; ++ } ++ + @Nullable + public String getTitle() { + return mTitle; +@@ -158,6 +164,7 @@ public class NotificationContent implements Parcelable, Serializable, INotificat + } + + protected NotificationContent(Parcel in) { ++ mChannelId = in.readString(); + mTitle = in.readString(); + mText = in.readString(); + mSubtitle = in.readString(); +@@ -183,6 +190,7 @@ public class NotificationContent implements Parcelable, Serializable, INotificat + + @Override + public void writeToParcel(Parcel dest, int flags) { ++ dest.writeString(mChannelId); + dest.writeString(mTitle); + dest.writeString(mText); + dest.writeString(mSubtitle); +@@ -203,6 +211,7 @@ public class NotificationContent implements Parcelable, Serializable, INotificat + private static final long serialVersionUID = 397666843266836802L; + + private void writeObject(java.io.ObjectOutputStream out) throws IOException { ++ out.writeObject(mChannelId); + out.writeObject(mTitle); + out.writeObject(mText); + out.writeObject(mSubtitle); +@@ -285,6 +294,11 @@ public class NotificationContent implements Parcelable, Serializable, INotificat + useDefaultVibrationPattern(); + } + ++ public Builder setChannelId(String channelId) { ++ content.mChannelId = channelId; ++ return this; ++ } ++ + public Builder setTitle(String title) { + content.mTitle = title; + return this; +diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationData.kt b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationData.kt +index 3af254c..3c77e9d 100644 +--- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationData.kt ++++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationData.kt +@@ -11,6 +11,9 @@ import org.json.JSONObject + * */ + @JvmInline + value class NotificationData(private val data: Map) { ++ val channelId: String? ++ get() = data["channelId"] ++ + val title: String? + get() = data["title"] + +diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/RemoteNotificationContent.kt b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/RemoteNotificationContent.kt +index d2cc6cf..6a48ff2 100644 +--- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/RemoteNotificationContent.kt ++++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/RemoteNotificationContent.kt +@@ -31,6 +31,8 @@ class RemoteNotificationContent(private val remoteMessage: RemoteMessage) : INot + return remoteMessage.notification?.imageUrl != null + } + ++ override val channelId = remoteMessage.notification?.channelId ?: notificationData.channelId ++ + override val title = remoteMessage.notification?.title ?: notificationData.title + + override val text = remoteMessage.notification?.body ?: notificationData.message +diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.kt b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.kt +index 98f003f..2f745e8 100644 +--- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.kt ++++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.kt +@@ -101,6 +101,9 @@ open class ExpoNotificationBuilder( + builder.setOngoing(content.isSticky) + + // see "Notification anatomy" https://developer.android.com/develop/ui/views/notifications#Templates ++ content.channelId?.let { ++ builder.setChannelId(it) ++ } + builder.setContentTitle(content.title) + builder.setContentText(content.text) + builder.setSubText(content.subText) +diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt +index 90ca4ff..9d4cb09 100644 +--- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt ++++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt +@@ -3,6 +3,9 @@ package expo.modules.notifications.service.delegates + import android.content.Context + import android.os.Bundle + import com.google.firebase.messaging.RemoteMessage ++import expo.modules.backgroundnotificationhandler.BackgroundNotificationHandler ++import expo.modules.backgroundnotificationhandler.BackgroundNotificationHandlerInterface ++import expo.modules.backgroundnotificationhandler.ExpoBackgroundNotificationHandlerModule + import expo.modules.interfaces.taskManager.TaskServiceProviderHelper + import expo.modules.notifications.notifications.RemoteMessageSerializer + import expo.modules.notifications.notifications.background.BackgroundRemoteNotificationTaskConsumer +@@ -18,7 +21,7 @@ import expo.modules.notifications.tokens.interfaces.FirebaseTokenListener + import java.lang.ref.WeakReference + import java.util.* + +-open class FirebaseMessagingDelegate(protected val context: Context) : FirebaseMessagingDelegate { ++open class FirebaseMessagingDelegate(protected val context: Context) : FirebaseMessagingDelegate, BackgroundNotificationHandlerInterface{ + companion object { + // Unfortunately we cannot save state between instances of a service other way + // than by static properties. Fortunately, using weak references we can +@@ -105,8 +108,19 @@ open class FirebaseMessagingDelegate(protected val context: Context) : FirebaseM + DebugLogging.logRemoteMessage("FirebaseMessagingDelegate.onMessageReceived: message", remoteMessage) + val notification = createNotification(remoteMessage) + DebugLogging.logNotification("FirebaseMessagingDelegate.onMessageReceived: notification", notification) +- NotificationsService.receive(context, notification) +- runTaskManagerTasks(context.applicationContext, RemoteMessageSerializer.toBundle(remoteMessage)) ++ if (!ExpoBackgroundNotificationHandlerModule.isForegrounded) { ++ BackgroundNotificationHandler(context, this).handleMessage(remoteMessage) ++ } else { ++ NotificationsService.receive(context, notification) ++ runTaskManagerTasks( ++ context.applicationContext, ++ RemoteMessageSerializer.toBundle(remoteMessage) ++ ) ++ } ++ } ++ ++ override fun showMessage(remoteMessage: RemoteMessage) { ++ NotificationsService.receive(context, createNotification(remoteMessage)) + } + + protected fun createNotification(remoteMessage: RemoteMessage): Notification { diff --git a/patches/expo-notifications+0.31.1.patch.md b/patches/expo-notifications+0.31.1.patch.md new file mode 100644 index 000000000..05f841725 --- /dev/null +++ b/patches/expo-notifications+0.31.1.patch.md @@ -0,0 +1,14 @@ +## LOAD BEARING PATCH, DO NOT REMOVE + +## Expo-Notifications Patch + +This patch supports the Android background notification handling module. Incoming messages +in `onMessageReceived` are sent to the module for handling. + +It also allows us to set the Android notification channel ID from the notification `data`, rather +than the `notification` object in the payload. + +### `setBadgeCountAsync` fix on Android + +`ShortcutBadger`'s `setCount` doesn't work for clearing the badge on Android for some reason. Instead, let's use the +Android API for clearing the badge. diff --git a/patches/expo-updates+0.26.10.patch.md b/patches/expo-updates+0.26.10.patch.md deleted file mode 100644 index 6d5d7093d..000000000 --- a/patches/expo-updates+0.26.10.patch.md +++ /dev/null @@ -1,7 +0,0 @@ -# Expo-Updates Patch - -This is a small patch to convert timestamp formats that are returned from the backend. Instead of relying on the -backend to return the correct format for a specific format (the format required on Android is not the same as on iOS) -we can just add this conversion in. - -Don't remove unless we make changes on the backend to support both platforms. diff --git a/patches/expo-updates+0.27.4.patch b/patches/expo-updates+0.27.4.patch deleted file mode 100644 index 6fc4fc5fc..000000000 --- a/patches/expo-updates+0.27.4.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/node_modules/expo-updates/ios/EXUpdates/Update/ExpoUpdatesUpdate.swift b/node_modules/expo-updates/ios/EXUpdates/Update/ExpoUpdatesUpdate.swift -index b85291e..546709d 100644 ---- a/node_modules/expo-updates/ios/EXUpdates/Update/ExpoUpdatesUpdate.swift -+++ b/node_modules/expo-updates/ios/EXUpdates/Update/ExpoUpdatesUpdate.swift -@@ -78,13 +78,20 @@ public final class ExpoUpdatesUpdate: Update { - status = UpdateStatus.StatusPending - } - -+ // Instead of relying on various hacks to get the correct format for the specific -+ // platform on the backend, we can just add this little patch.. -+ let dateFormatter = DateFormatter() -+ dateFormatter.locale = Locale(identifier: "en_US_POSIX") -+ dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" -+ let date = dateFormatter.date(from:commitTime) ?? RCTConvert.nsDate(commitTime)! -+ - return Update( - manifest: manifest, - config: config, - database: database, - updateId: uuid, - scopeKey: config.scopeKey, -- commitTime: RCTConvert.nsDate(commitTime), -+ commitTime: date, - runtimeVersion: runtimeVersion, - keep: true, - status: status, diff --git a/patches/expo-updates+0.28.12.patch b/patches/expo-updates+0.28.12.patch new file mode 100644 index 000000000..6fc4fc5fc --- /dev/null +++ b/patches/expo-updates+0.28.12.patch @@ -0,0 +1,26 @@ +diff --git a/node_modules/expo-updates/ios/EXUpdates/Update/ExpoUpdatesUpdate.swift b/node_modules/expo-updates/ios/EXUpdates/Update/ExpoUpdatesUpdate.swift +index b85291e..546709d 100644 +--- a/node_modules/expo-updates/ios/EXUpdates/Update/ExpoUpdatesUpdate.swift ++++ b/node_modules/expo-updates/ios/EXUpdates/Update/ExpoUpdatesUpdate.swift +@@ -78,13 +78,20 @@ public final class ExpoUpdatesUpdate: Update { + status = UpdateStatus.StatusPending + } + ++ // Instead of relying on various hacks to get the correct format for the specific ++ // platform on the backend, we can just add this little patch.. ++ let dateFormatter = DateFormatter() ++ dateFormatter.locale = Locale(identifier: "en_US_POSIX") ++ dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" ++ let date = dateFormatter.date(from:commitTime) ?? RCTConvert.nsDate(commitTime)! ++ + return Update( + manifest: manifest, + config: config, + database: database, + updateId: uuid, + scopeKey: config.scopeKey, +- commitTime: RCTConvert.nsDate(commitTime), ++ commitTime: date, + runtimeVersion: runtimeVersion, + keep: true, + status: status, diff --git a/patches/expo-updates+0.28.12.patch.md b/patches/expo-updates+0.28.12.patch.md new file mode 100644 index 000000000..6d5d7093d --- /dev/null +++ b/patches/expo-updates+0.28.12.patch.md @@ -0,0 +1,7 @@ +# Expo-Updates Patch + +This is a small patch to convert timestamp formats that are returned from the backend. Instead of relying on the +backend to return the correct format for a specific format (the format required on Android is not the same as on iOS) +we can just add this conversion in. + +Don't remove unless we make changes on the backend to support both platforms. diff --git a/patches/react-native+0.76.6.patch.md b/patches/react-native+0.76.6.patch.md deleted file mode 100644 index eacb9f267..000000000 --- a/patches/react-native+0.76.6.patch.md +++ /dev/null @@ -1,17 +0,0 @@ -# ***This second part of this patch is load bearing, do not remove.*** - -## RefreshControl Patch - iOS 17.4 Haptic Regression - -Patching `RCTRefreshControl.mm` temporarily to play an impact haptic on refresh when using iOS 17.4 or higher. Since -17.4, there has been a regression somewhere causing haptics to not play on iOS on refresh. Should monitor for an update -in the RN repo: https://github.com/facebook/react-native/issues/43388 - -## RefreshControl Path - ScrollForwarder - -Patching `RCTRefreshControl.m` and `RCTRefreshControl.h` to add a new `forwarderBeginRefreshing` method to the class. -This method is used by `ExpoScrollForwarder` to initiate a refresh of the underlying `UIScrollView` from inside that -module. - -## ScrollView centerContent fix - -Includes https://github.com/facebook/react-native/pull/47591 early. Delete when it's in a release. diff --git a/patches/react-native+0.76.9.patch b/patches/react-native+0.76.9.patch deleted file mode 100644 index 7e96d875c..000000000 --- a/patches/react-native+0.76.9.patch +++ /dev/null @@ -1,366 +0,0 @@ -diff --git a/node_modules/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts b/node_modules/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts -index 62f52a7..ca30165 100644 ---- a/node_modules/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts -+++ b/node_modules/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts -@@ -426,9 +426,10 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle { - */ - pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined; - isolation?: 'auto' | 'isolate' | undefined; -- cursor?: CursorValue | undefined; -+ cursor?: CursorValue | string | undefined; - boxShadow?: ReadonlyArray | string | undefined; - filter?: ReadonlyArray | string | undefined; -+ transformOrigin?: string | (string | number)[] | undefined; - } - - export type FontVariant = -@@ -536,7 +537,11 @@ export interface TextStyle extends TextStyleIOS, TextStyleAndroid, ViewStyle { - textShadowOffset?: {width: number; height: number} | undefined; - textShadowRadius?: number | undefined; - textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase' | undefined; -- userSelect?: 'auto' | 'none' | 'text' | 'contain' | 'all' | undefined; -+ userSelect?: 'auto' | 'none' | 'text' | 'contain' | 'all' | string | undefined; -+ cursor?: CursorValue | string | undefined; -+ boxShadow?: ReadonlyArray | string | undefined; -+ filter?: ReadonlyArray | string | undefined; -+ transformOrigin?: string | (string | number)[] | undefined; - } - - /** -@@ -558,5 +563,8 @@ export interface ImageStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle { - tintColor?: ColorValue | undefined; - opacity?: AnimatableNumericValue | undefined; - objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | undefined; -- cursor?: CursorValue | undefined; -+ cursor?: CursorValue | string | undefined; -+ boxShadow?: ReadonlyArray | string | undefined; -+ filter?: ReadonlyArray | string | undefined; -+ transformOrigin?: string | (string | number)[] | undefined; - } -diff --git a/node_modules/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm b/node_modules/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm -index 93af874..106f8ec 100644 ---- a/node_modules/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm -+++ b/node_modules/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm -@@ -66,28 +66,51 @@ - * ScrollView, we force it to be centered, but when you zoom or the content otherwise - * becomes larger than the ScrollView, there is no padding around the content but it - * can still fill the whole view. -+ * This implementation is based on https://petersteinberger.com/blog/2013/how-to-center-uiscrollview/. - */ --- (void)setContentOffset:(CGPoint)contentOffset -+-(void)centerContentIfNeeded - { -- if (_isSetContentOffsetDisabled) { -+ if (!_centerContent) { - return; - } - -- if (_centerContent && !CGSizeEqualToSize(self.contentSize, CGSizeZero)) { -- CGSize scrollViewSize = self.bounds.size; -- if (self.contentSize.width <= scrollViewSize.width) { -- contentOffset.x = -(scrollViewSize.width - self.contentSize.width) / 2.0; -- } -- if (self.contentSize.height <= scrollViewSize.height) { -- contentOffset.y = -(scrollViewSize.height - self.contentSize.height) / 2.0; -- } -+ CGSize contentSize = self.contentSize; -+ CGSize boundsSize = self.bounds.size; -+ if (CGSizeEqualToSize(contentSize, CGSizeZero) || -+ CGSizeEqualToSize(boundsSize, CGSizeZero)) { -+ return; - } - -+ CGFloat top = 0, left = 0; -+ if (contentSize.width < boundsSize.width) { -+ left = (boundsSize.width - contentSize.width) * 0.5f; -+ } -+ if (contentSize.height < boundsSize.height) { -+ top = (boundsSize.height - contentSize.height) * 0.5f; -+ } -+ self.contentInset = UIEdgeInsetsMake(top, left, top, left); -+} -+ -+- (void)setContentOffset:(CGPoint)contentOffset -+{ -+ if (_isSetContentOffsetDisabled) { -+ return; -+ } - super.contentOffset = CGPointMake( - RCTSanitizeNaNValue(contentOffset.x, @"scrollView.contentOffset.x"), - RCTSanitizeNaNValue(contentOffset.y, @"scrollView.contentOffset.y")); - } - -+- (void)setFrame:(CGRect)frame { -+ [super setFrame:frame]; -+ [self centerContentIfNeeded]; -+} -+ -+- (void)didAddSubview:(UIView *)subview { -+ [super didAddSubview:subview]; -+ [self centerContentIfNeeded]; -+} -+ - - (BOOL)touchesShouldCancelInContentView:(UIView *)view - { - if ([_overridingDelegate respondsToSelector:@selector(touchesShouldCancelInContentView:)]) { -@@ -257,6 +280,10 @@ - } - } - -+- (void)scrollViewDidZoom:(__unused UIScrollView *)scrollView { -+ [self centerContentIfNeeded]; -+} -+ - #pragma mark - - - - (BOOL)isHorizontal:(UIScrollView *)scrollView -diff --git a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h -index e9b330f..ec5f58c 100644 ---- a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h -+++ b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h -@@ -15,5 +15,8 @@ - @property (nonatomic, copy) NSString *title; - @property (nonatomic, copy) RCTDirectEventBlock onRefresh; - @property (nonatomic, weak) UIScrollView *scrollView; -+@property (nonatomic, copy) UIColor *customTintColor; -+ -+- (void)forwarderBeginRefreshing; - - @end -diff --git a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m -index 53bfd04..ff1b1ed 100644 ---- a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m -+++ b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m -@@ -23,6 +23,7 @@ - UIColor *_titleColor; - CGFloat _progressViewOffset; - BOOL _hasMovedToWindow; -+ UIColor *_customTintColor; - } - - - (instancetype)init -@@ -58,6 +59,12 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) - _isInitialRender = false; - } - -+- (void)didMoveToSuperview -+{ -+ [super didMoveToSuperview]; -+ [self setTintColor:_customTintColor]; -+} -+ - - (void)didMoveToWindow - { - [super didMoveToWindow]; -@@ -221,4 +228,50 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) - } - } - -+// Fix for https://github.com/facebook/react-native/issues/43388 -+// A bug in iOS 17.4 causes the haptic to not play when refreshing if the tintColor -+// is set before the refresh control gets added to the scrollview. We'll call this -+// function whenever the superview changes. We'll also call it if the value of customTintColor -+// changes. -+- (void)setTintColor:(UIColor *)tintColor -+{ -+ if ([self.superview isKindOfClass:[UIScrollView class]] && self.tintColor != tintColor) { -+ [super setTintColor:tintColor]; -+ } -+} -+ -+// This method is used by Bluesky's ExpoScrollForwarder. This allows other React Native -+// libraries to perform a refresh of a scrollview and access the refresh control's onRefresh -+// function. -+- (void)forwarderBeginRefreshing -+{ -+ _refreshingProgrammatically = NO; -+ -+ [self sizeToFit]; -+ -+ if (!self.scrollView) { -+ return; -+ } -+ -+ UIScrollView *scrollView = (UIScrollView *)self.scrollView; -+ -+ [UIView animateWithDuration:0.3 -+ delay:0 -+ options:UIViewAnimationOptionBeginFromCurrentState -+ animations:^(void) { -+ // Whenever we call this method, the scrollview will always be at a position of -+ // -130 or less. Scrolling back to -65 simulates the default behavior of RCTRefreshControl -+ [scrollView setContentOffset:CGPointMake(0, -65)]; -+ } -+ completion:^(__unused BOOL finished) { -+ [super beginRefreshing]; -+ [self setCurrentRefreshingState:super.refreshing]; -+ -+ if (self->_onRefresh) { -+ self->_onRefresh(nil); -+ } -+ } -+ ]; -+} -+ - @end -diff --git a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m -index 40aaf9c..1c60164 100644 ---- a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m -+++ b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m -@@ -22,11 +22,12 @@ RCT_EXPORT_MODULE() - - RCT_EXPORT_VIEW_PROPERTY(onRefresh, RCTDirectEventBlock) - RCT_EXPORT_VIEW_PROPERTY(refreshing, BOOL) --RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor) - RCT_EXPORT_VIEW_PROPERTY(title, NSString) - RCT_EXPORT_VIEW_PROPERTY(titleColor, UIColor) - RCT_EXPORT_VIEW_PROPERTY(progressViewOffset, CGFloat) - -+RCT_REMAP_VIEW_PROPERTY(tintColor, customTintColor, UIColor) -+ - RCT_EXPORT_METHOD(setNativeRefreshing : (nonnull NSNumber *)viewTag toRefreshing : (BOOL)refreshing) - { - [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) { -diff --git a/node_modules/react-native/React/Views/ScrollView/RCTScrollView.m b/node_modules/react-native/React/Views/ScrollView/RCTScrollView.m -index 6f41b5c..9b4f77f 100644 ---- a/node_modules/react-native/React/Views/ScrollView/RCTScrollView.m -+++ b/node_modules/react-native/React/Views/ScrollView/RCTScrollView.m -@@ -159,26 +159,8 @@ - return !shouldDisableScrollInteraction; - } - --/* -- * Automatically centers the content such that if the content is smaller than the -- * ScrollView, we force it to be centered, but when you zoom or the content otherwise -- * becomes larger than the ScrollView, there is no padding around the content but it -- * can still fill the whole view. -- */ - - (void)setContentOffset:(CGPoint)contentOffset - { -- UIView *contentView = [self contentView]; -- if (contentView && _centerContent && !CGSizeEqualToSize(contentView.frame.size, CGSizeZero)) { -- CGSize subviewSize = contentView.frame.size; -- CGSize scrollViewSize = self.bounds.size; -- if (subviewSize.width <= scrollViewSize.width) { -- contentOffset.x = -(scrollViewSize.width - subviewSize.width) / 2.0; -- } -- if (subviewSize.height <= scrollViewSize.height) { -- contentOffset.y = -(scrollViewSize.height - subviewSize.height) / 2.0; -- } -- } -- - super.contentOffset = CGPointMake( - RCTSanitizeNaNValue(contentOffset.x, @"scrollView.contentOffset.x"), - RCTSanitizeNaNValue(contentOffset.y, @"scrollView.contentOffset.y")); -@@ -433,6 +415,11 @@ static inline void RCTApplyTransformationAccordingLayoutDirection( - // Does nothing - } - -+- (void)setFrame:(CGRect)frame { -+ [super setFrame:frame]; -+ [self centerContentIfNeeded]; -+} -+ - - (void)insertReactSubview:(UIView *)view atIndex:(NSInteger)atIndex - { - [super insertReactSubview:view atIndex:atIndex]; -@@ -449,6 +436,8 @@ static inline void RCTApplyTransformationAccordingLayoutDirection( - _contentView = view; - RCTApplyTransformationAccordingLayoutDirection(_contentView, self.reactLayoutDirection); - [_scrollView addSubview:view]; -+ -+ [self centerContentIfNeeded]; - } - } - -@@ -658,9 +647,46 @@ static inline void RCTApplyTransformationAccordingLayoutDirection( - } - - RCT_SCROLL_EVENT_HANDLER(scrollViewWillBeginDecelerating, onMomentumScrollBegin) --RCT_SCROLL_EVENT_HANDLER(scrollViewDidZoom, onScroll) - RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop) - -+-(void)scrollViewDidZoom : (UIScrollView *)scrollView -+{ -+ [self centerContentIfNeeded]; -+ -+ RCT_SEND_SCROLL_EVENT(onScroll, nil); -+ RCT_FORWARD_SCROLL_EVENT(scrollViewDidZoom : scrollView); -+} -+ -+/* -+ * Automatically centers the content such that if the content is smaller than the -+ * ScrollView, we force it to be centered, but when you zoom or the content otherwise -+ * becomes larger than the ScrollView, there is no padding around the content but it -+ * can still fill the whole view. -+ * This implementation is based on https://petersteinberger.com/blog/2013/how-to-center-uiscrollview/. -+ */ -+-(void)centerContentIfNeeded -+{ -+ if (!_scrollView.centerContent) { -+ return; -+ } -+ -+ CGSize contentSize = self.contentSize; -+ CGSize boundsSize = self.bounds.size; -+ if (CGSizeEqualToSize(contentSize, CGSizeZero) || -+ CGSizeEqualToSize(boundsSize, CGSizeZero)) { -+ return; -+ } -+ -+ CGFloat top = 0, left = 0; -+ if (contentSize.width < boundsSize.width) { -+ left = (boundsSize.width - contentSize.width) * 0.5f; -+ } -+ if (contentSize.height < boundsSize.height) { -+ top = (boundsSize.height - contentSize.height) * 0.5f; -+ } -+ _scrollView.contentInset = UIEdgeInsetsMake(top, left, top, left); -+} -+ - - (void)addScrollListener:(NSObject *)scrollListener - { - [_scrollListeners addObject:scrollListener]; -@@ -939,6 +965,7 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop) - CGSize contentSize = self.contentSize; - if (!CGSizeEqualToSize(_scrollView.contentSize, contentSize)) { - _scrollView.contentSize = contentSize; -+ [self centerContentIfNeeded]; - } - } - -@@ -1061,6 +1088,22 @@ RCT_SET_AND_PRESERVE_OFFSET(setShowsHorizontalScrollIndicator, showsHorizontalSc - RCT_SET_AND_PRESERVE_OFFSET(setShowsVerticalScrollIndicator, showsVerticalScrollIndicator, BOOL) - RCT_SET_AND_PRESERVE_OFFSET(setZoomScale, zoomScale, CGFloat); - -+- (void)setScrollIndicatorInsets:(UIEdgeInsets)value -+{ -+ [_scrollView setScrollIndicatorInsets:value]; -+} -+ -+- (UIEdgeInsets)scrollIndicatorInsets -+{ -+ UIEdgeInsets verticalScrollIndicatorInsets = [_scrollView verticalScrollIndicatorInsets]; -+ UIEdgeInsets horizontalScrollIndicatorInsets = [_scrollView horizontalScrollIndicatorInsets]; -+ return UIEdgeInsetsMake( -+ verticalScrollIndicatorInsets.top, -+ horizontalScrollIndicatorInsets.left, -+ verticalScrollIndicatorInsets.bottom, -+ horizontalScrollIndicatorInsets.right); -+} -+ - - (void)setAutomaticallyAdjustsScrollIndicatorInsets:(BOOL)automaticallyAdjusts API_AVAILABLE(ios(13.0)) - { - // `automaticallyAdjustsScrollIndicatorInsets` is available since iOS 13. -diff --git a/node_modules/react-native/React/Views/ScrollView/RCTScrollViewManager.m b/node_modules/react-native/React/Views/ScrollView/RCTScrollViewManager.m -index cd1e7eb..c1d0172 100644 ---- a/node_modules/react-native/React/Views/ScrollView/RCTScrollViewManager.m -+++ b/node_modules/react-native/React/Views/ScrollView/RCTScrollViewManager.m -@@ -83,6 +83,7 @@ RCT_EXPORT_VIEW_PROPERTY(showsVerticalScrollIndicator, BOOL) - RCT_EXPORT_VIEW_PROPERTY(scrollEventThrottle, NSTimeInterval) - RCT_EXPORT_VIEW_PROPERTY(zoomScale, CGFloat) - RCT_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets) -+RCT_EXPORT_VIEW_PROPERTY(scrollIndicatorInsets, UIEdgeInsets) - RCT_EXPORT_VIEW_PROPERTY(verticalScrollIndicatorInsets, UIEdgeInsets) - RCT_EXPORT_VIEW_PROPERTY(scrollToOverflowEnabled, BOOL) - RCT_EXPORT_VIEW_PROPERTY(snapToInterval, int) diff --git a/patches/react-native+0.79.2.patch b/patches/react-native+0.79.2.patch new file mode 100644 index 000000000..609ae6617 --- /dev/null +++ b/patches/react-native+0.79.2.patch @@ -0,0 +1,119 @@ +diff --git a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h +index e9b330f..ec5f58c 100644 +--- a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h ++++ b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h +@@ -15,5 +15,8 @@ + @property (nonatomic, copy) NSString *title; + @property (nonatomic, copy) RCTDirectEventBlock onRefresh; + @property (nonatomic, weak) UIScrollView *scrollView; ++@property (nonatomic, copy) UIColor *customTintColor; ++ ++- (void)forwarderBeginRefreshing; + + @end +diff --git a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m +index 53bfd04..ff1b1ed 100644 +--- a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m ++++ b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m +@@ -23,6 +23,7 @@ + UIColor *_titleColor; + CGFloat _progressViewOffset; + BOOL _hasMovedToWindow; ++ UIColor *_customTintColor; + } + + - (instancetype)init +@@ -58,6 +59,12 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) + _isInitialRender = false; + } + ++- (void)didMoveToSuperview ++{ ++ [super didMoveToSuperview]; ++ [self setTintColor:_customTintColor]; ++} ++ + - (void)didMoveToWindow + { + [super didMoveToWindow]; +@@ -221,4 +228,50 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) + } + } + ++// Fix for https://github.com/facebook/react-native/issues/43388 ++// A bug in iOS 17.4 causes the haptic to not play when refreshing if the tintColor ++// is set before the refresh control gets added to the scrollview. We'll call this ++// function whenever the superview changes. We'll also call it if the value of customTintColor ++// changes. ++- (void)setTintColor:(UIColor *)tintColor ++{ ++ if ([self.superview isKindOfClass:[UIScrollView class]] && self.tintColor != tintColor) { ++ [super setTintColor:tintColor]; ++ } ++} ++ ++// This method is used by Bluesky's ExpoScrollForwarder. This allows other React Native ++// libraries to perform a refresh of a scrollview and access the refresh control's onRefresh ++// function. ++- (void)forwarderBeginRefreshing ++{ ++ _refreshingProgrammatically = NO; ++ ++ [self sizeToFit]; ++ ++ if (!self.scrollView) { ++ return; ++ } ++ ++ UIScrollView *scrollView = (UIScrollView *)self.scrollView; ++ ++ [UIView animateWithDuration:0.3 ++ delay:0 ++ options:UIViewAnimationOptionBeginFromCurrentState ++ animations:^(void) { ++ // Whenever we call this method, the scrollview will always be at a position of ++ // -130 or less. Scrolling back to -65 simulates the default behavior of RCTRefreshControl ++ [scrollView setContentOffset:CGPointMake(0, -65)]; ++ } ++ completion:^(__unused BOOL finished) { ++ [super beginRefreshing]; ++ [self setCurrentRefreshingState:super.refreshing]; ++ ++ if (self->_onRefresh) { ++ self->_onRefresh(nil); ++ } ++ } ++ ]; ++} ++ + @end +diff --git a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m +index 40aaf9c..1c60164 100644 +--- a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m ++++ b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m +@@ -22,11 +22,12 @@ RCT_EXPORT_MODULE() + + RCT_EXPORT_VIEW_PROPERTY(onRefresh, RCTDirectEventBlock) + RCT_EXPORT_VIEW_PROPERTY(refreshing, BOOL) +-RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor) + RCT_EXPORT_VIEW_PROPERTY(title, NSString) + RCT_EXPORT_VIEW_PROPERTY(titleColor, UIColor) + RCT_EXPORT_VIEW_PROPERTY(progressViewOffset, CGFloat) + ++RCT_REMAP_VIEW_PROPERTY(tintColor, customTintColor, UIColor) ++ + RCT_EXPORT_METHOD(setNativeRefreshing : (nonnull NSNumber *)viewTag toRefreshing : (BOOL)refreshing) + { + [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) { +diff --git a/node_modules/react-native/React/Views/ScrollView/RCTScrollViewManager.m b/node_modules/react-native/React/Views/ScrollView/RCTScrollViewManager.m +index cd1e7eb..c1d0172 100644 +--- a/node_modules/react-native/React/Views/ScrollView/RCTScrollViewManager.m ++++ b/node_modules/react-native/React/Views/ScrollView/RCTScrollViewManager.m +@@ -83,6 +83,7 @@ RCT_EXPORT_VIEW_PROPERTY(showsVerticalScrollIndicator, BOOL) + RCT_EXPORT_VIEW_PROPERTY(scrollEventThrottle, NSTimeInterval) + RCT_EXPORT_VIEW_PROPERTY(zoomScale, CGFloat) + RCT_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets) ++RCT_EXPORT_VIEW_PROPERTY(scrollIndicatorInsets, UIEdgeInsets) + RCT_EXPORT_VIEW_PROPERTY(verticalScrollIndicatorInsets, UIEdgeInsets) + RCT_EXPORT_VIEW_PROPERTY(scrollToOverflowEnabled, BOOL) + RCT_EXPORT_VIEW_PROPERTY(snapToInterval, int) diff --git a/patches/react-native+0.79.2.patch.md b/patches/react-native+0.79.2.patch.md new file mode 100644 index 000000000..9c93aee5c --- /dev/null +++ b/patches/react-native+0.79.2.patch.md @@ -0,0 +1,13 @@ +# ***This second part of this patch is load bearing, do not remove.*** + +## RefreshControl Patch - iOS 17.4 Haptic Regression + +Patching `RCTRefreshControl.mm` temporarily to play an impact haptic on refresh when using iOS 17.4 or higher. Since +17.4, there has been a regression somewhere causing haptics to not play on iOS on refresh. Should monitor for an update +in the RN repo: https://github.com/facebook/react-native/issues/43388 + +## RefreshControl Path - ScrollForwarder + +Patching `RCTRefreshControl.m` and `RCTRefreshControl.h` to add a new `forwarderBeginRefreshing` method to the class. +This method is used by `ExpoScrollForwarder` to initiate a refresh of the underlying `UIScrollView` from inside that +module. diff --git a/patches/react-native-gesture-handler+2.20.2.patch b/patches/react-native-gesture-handler+2.20.2.patch deleted file mode 100644 index 431a9ab3e..000000000 --- a/patches/react-native-gesture-handler+2.20.2.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/node_modules/react-native-gesture-handler/apple/RNGestureHandler.mm b/node_modules/react-native-gesture-handler/apple/RNGestureHandler.mm -index 43d11b4..5bf0d32 100644 ---- a/node_modules/react-native-gesture-handler/apple/RNGestureHandler.mm -+++ b/node_modules/react-native-gesture-handler/apple/RNGestureHandler.mm -@@ -461,16 +461,23 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer - - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer - shouldRequireFailureOfGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer - { -- if ([_handlersToWaitFor count]) { -- RNGestureHandler *handler = [RNGestureHandler findGestureHandlerByRecognizer:otherGestureRecognizer]; -- if (handler != nil) { -- for (NSNumber *handlerTag in _handlersToWaitFor) { -- if ([handler.tag isEqual:handlerTag]) { -- return YES; -- } -- } -+ RNGestureHandler *handler = [RNGestureHandler findGestureHandlerByRecognizer:otherGestureRecognizer]; -+ if (handler == nil) { -+ return NO; -+ } -+ -+ for (NSNumber *handlerTag in _handlersToWaitFor) { -+ if ([handler.tag isEqual:handlerTag]) { -+ return YES; - } - } -+ -+ for (NSNumber *handlerTag in handler->_handlersThatShouldWait) { -+ if ([_tag isEqual:handlerTag]) { -+ return YES; -+ } -+ } -+ - return NO; - } - diff --git a/patches/react-native-gesture-handler+2.25.0.patch b/patches/react-native-gesture-handler+2.25.0.patch new file mode 100644 index 000000000..431a9ab3e --- /dev/null +++ b/patches/react-native-gesture-handler+2.25.0.patch @@ -0,0 +1,36 @@ +diff --git a/node_modules/react-native-gesture-handler/apple/RNGestureHandler.mm b/node_modules/react-native-gesture-handler/apple/RNGestureHandler.mm +index 43d11b4..5bf0d32 100644 +--- a/node_modules/react-native-gesture-handler/apple/RNGestureHandler.mm ++++ b/node_modules/react-native-gesture-handler/apple/RNGestureHandler.mm +@@ -461,16 +461,23 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer + - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer + shouldRequireFailureOfGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer + { +- if ([_handlersToWaitFor count]) { +- RNGestureHandler *handler = [RNGestureHandler findGestureHandlerByRecognizer:otherGestureRecognizer]; +- if (handler != nil) { +- for (NSNumber *handlerTag in _handlersToWaitFor) { +- if ([handler.tag isEqual:handlerTag]) { +- return YES; +- } +- } ++ RNGestureHandler *handler = [RNGestureHandler findGestureHandlerByRecognizer:otherGestureRecognizer]; ++ if (handler == nil) { ++ return NO; ++ } ++ ++ for (NSNumber *handlerTag in _handlersToWaitFor) { ++ if ([handler.tag isEqual:handlerTag]) { ++ return YES; + } + } ++ ++ for (NSNumber *handlerTag in handler->_handlersThatShouldWait) { ++ if ([_tag isEqual:handlerTag]) { ++ return YES; ++ } ++ } ++ + return NO; + } + diff --git a/patches/react-native-image-crop-picker+0.41.6.patch b/patches/react-native-image-crop-picker+0.41.6.patch deleted file mode 100644 index 57589931a..000000000 --- a/patches/react-native-image-crop-picker+0.41.6.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/node_modules/react-native-image-crop-picker/android/src/main/AndroidManifest.xml b/node_modules/react-native-image-crop-picker/android/src/main/AndroidManifest.xml -index 391f303..8e2c3db 100644 ---- a/node_modules/react-native-image-crop-picker/android/src/main/AndroidManifest.xml -+++ b/node_modules/react-native-image-crop-picker/android/src/main/AndroidManifest.xml -@@ -24,7 +24,7 @@ - - -+ android:theme="@style/Theme.UCropNoEdgeToEdge" /> - - - -diff --git a/node_modules/react-native-image-crop-picker/android/src/main/res/values-v35/styles.xml b/node_modules/react-native-image-crop-picker/android/src/main/res/values-v35/styles.xml -new file mode 100644 -index 0000000..396d5a8 ---- /dev/null -+++ b/node_modules/react-native-image-crop-picker/android/src/main/res/values-v35/styles.xml -@@ -0,0 +1,5 @@ -+ -+ -+ -diff --git a/node_modules/react-native-image-crop-picker/android/src/main/res/values/styles.xml b/node_modules/react-native-image-crop-picker/android/src/main/res/values/styles.xml -new file mode 100644 -index 0000000..50129b6 ---- /dev/null -+++ b/node_modules/react-native-image-crop-picker/android/src/main/res/values/styles.xml -@@ -0,0 +1,3 @@ -+ -+ ++ +\ No newline at end of file +diff --git a/node_modules/react-native-image-crop-picker/android/src/main/res/values/styles.xml b/node_modules/react-native-image-crop-picker/android/src/main/res/values/styles.xml +new file mode 100644 +index 0000000..55569aa +--- /dev/null ++++ b/node_modules/react-native-image-crop-picker/android/src/main/res/values/styles.xml +@@ -0,0 +1,3 @@ ++ ++