From 84eca3baa40d57ffe48bef20bf46c53371b06fee Mon Sep 17 00:00:00 2001 From: Den <2119348+dzianisv@users.noreply.github.com> Date: Wed, 3 Jun 2026 03:06:41 -0700 Subject: [PATCH] fix(fdroid): Firebase-free stubs for expo-notifications --- .../model/RemoteNotificationContent.kt | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 fdroid/expo-notifications-patches/notifications/model/RemoteNotificationContent.kt diff --git a/fdroid/expo-notifications-patches/notifications/model/RemoteNotificationContent.kt b/fdroid/expo-notifications-patches/notifications/model/RemoteNotificationContent.kt new file mode 100644 index 0000000..c6980ce --- /dev/null +++ b/fdroid/expo-notifications-patches/notifications/model/RemoteNotificationContent.kt @@ -0,0 +1,43 @@ +package expo.modules.notifications.notifications.model + +import android.content.Context +import android.graphics.Bitmap +import android.os.Parcel +import android.os.Parcelable +import expo.modules.notifications.notifications.enums.NotificationPriority +import expo.modules.notifications.notifications.interfaces.INotificationContent +import org.json.JSONObject + +/** + * Stub RemoteNotificationContent (Firebase-free) for F-Droid builds. + * This class exists only for compile compatibility. It is never instantiated + * since no FCM messages are received without the Firebase SDK. + */ +class RemoteNotificationContent private constructor() : INotificationContent, Parcelable { + /** Always false — no data-only remote notifications without FCM. */ + val isDataOnly = false + + override val title: String? = null + override val text: String? = null + override val shouldPlayDefaultSound = false + override val soundName: String? = null + override val shouldUseDefaultVibrationPattern = false + override val vibrationPattern: LongArray? = null + override val body: JSONObject? = null + override val priority: NotificationPriority = NotificationPriority.DEFAULT + override val color: Number? = null + override val isAutoDismiss = true + override val categoryId: String? = null + override val isSticky = false + override val subText: String? = null + override val badgeCount: Number? = null + override suspend fun getImage(context: Context): Bitmap? = null + override fun containsImage() = false + override fun describeContents() = 0 + override fun writeToParcel(dest: Parcel, flags: Int) {} + + companion object CREATOR : Parcelable.Creator { + override fun createFromParcel(parcel: Parcel) = RemoteNotificationContent() + override fun newArray(size: Int) = arrayOfNulls(size) + } +}