From 9370a79fc6d5d59822bca9da091a2e41f6cb49a5 Mon Sep 17 00:00:00 2001 From: "courier-ios-automation[bot]" Date: Thu, 7 May 2026 20:51:00 +0000 Subject: [PATCH 1/5] Bump Courier_iOS to 5.8.1 --- courier-react-native.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/courier-react-native.podspec b/courier-react-native.podspec index 200e37a..5be3001 100644 --- a/courier-react-native.podspec +++ b/courier-react-native.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.source_files = "ios/**/*.{h,m,mm,swift}" # Courier Core Dependency - s.dependency "Courier_iOS", "5.8.0" + s.dependency "Courier_iOS", "5.8.1" # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79. From 32f2b5c084674a79e55a40e74265f3a3322c35f7 Mon Sep 17 00:00:00 2001 From: "courier-android-automation[bot]" Date: Thu, 7 May 2026 20:54:02 +0000 Subject: [PATCH 2/5] Bump courier-android to 5.3.1 --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 740e60e..da7de90 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -110,7 +110,7 @@ dependencies { implementation 'com.google.code.gson:gson:2.11.0' // Courier Core SDK - api 'com.github.trycourier:courier-android:5.3.0' + api 'com.github.trycourier:courier-android:5.3.1' api 'androidx.recyclerview:recyclerview:1.3.2' } From 491962d83b626c0a2b72677f5b9f5d2b5f7f403b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 7 May 2026 21:18:16 +0000 Subject: [PATCH 3/5] feat: add backgroundColor support to inbox and preferences themes - Add backgroundColor property to CourierInboxTheme and CourierPreferencesTheme TypeScript interfaces - Pass backgroundColor to native Android CourierInboxTheme and CourierPreferencesTheme constructors - Apply backgroundColor on iOS views based on current user interface style (light/dark) - Update example app to demonstrate backgroundColor usage in styled inbox and preferences Co-authored-by: Mike Miller --- .../com/courierreactnative/CourierInboxViewManager.kt | 2 ++ .../courierreactnative/CourierPreferencesViewManager.kt | 2 ++ example/src/pages/Styles.tsx | 1 + example/src/pages/inbox/InboxStyled.tsx | 1 + example/src/pages/preferences/PreferencesStyled.tsx | 1 + ios/CourierInboxReactNativeManager.swift | 8 ++++++++ ios/CourierPreferencesReactNativeManager.swift | 8 ++++++++ src/models/CourierInboxTheme.tsx | 1 + src/models/CourierPreferencesTheme.tsx | 1 + 9 files changed, 25 insertions(+) diff --git a/android/src/main/java/com/courierreactnative/CourierInboxViewManager.kt b/android/src/main/java/com/courierreactnative/CourierInboxViewManager.kt index b7ae44b..74e32ca 100644 --- a/android/src/main/java/com/courierreactnative/CourierInboxViewManager.kt +++ b/android/src/main/java/com/courierreactnative/CourierInboxViewManager.kt @@ -119,6 +119,7 @@ class CourierInboxViewManager : SimpleViewManager() { val dividerItemDecoration = android?.getString("dividerItemDecoration") val brandId = getString("brandId") + val backgroundColor = getString("backgroundColor") val tabIndicatorColor = getString("tabIndicatorColor") val tabStyle = getMap("tabStyle") @@ -139,6 +140,7 @@ class CourierInboxViewManager : SimpleViewManager() { return CourierInboxTheme( brandId = brandId, + backgroundColor = backgroundColor?.toColor(), tabIndicatorColor = tabIndicatorColor?.toColor(), tabStyle = tabStyle?.toTabStyle(context) ?: CourierStyles.Inbox.TabStyle( selected = CourierStyles.Inbox.TabItemStyle( diff --git a/android/src/main/java/com/courierreactnative/CourierPreferencesViewManager.kt b/android/src/main/java/com/courierreactnative/CourierPreferencesViewManager.kt index e0c14e9..74b651f 100644 --- a/android/src/main/java/com/courierreactnative/CourierPreferencesViewManager.kt +++ b/android/src/main/java/com/courierreactnative/CourierPreferencesViewManager.kt @@ -102,6 +102,7 @@ class CourierPreferencesViewManager : SimpleViewManager() { private fun ReadableMap.toTheme(view: CourierPreferences): CourierPreferencesTheme { val brandId = getString("brandId") + val backgroundColor = getString("backgroundColor") val loadingIndicatorColor = getString("loadingIndicatorColor") val sectionTitleFont = getMap("sectionTitleFont") val topicTitleFont = getMap("topicTitleFont") @@ -118,6 +119,7 @@ class CourierPreferencesViewManager : SimpleViewManager() { return CourierPreferencesTheme( brandId = brandId, + backgroundColor = backgroundColor?.toColor(), loadingIndicatorColor = loadingIndicatorColor?.toColor(), sectionTitleFont = sectionTitleFont?.toFont(context) ?: defaultTheme.sectionTitleFont, topicDividerItemDecoration = topicDividerItemDecoration?.toDivider(context), diff --git a/example/src/pages/Styles.tsx b/example/src/pages/Styles.tsx index ffbde73..48e59f0 100644 --- a/example/src/pages/Styles.tsx +++ b/example/src/pages/Styles.tsx @@ -11,6 +11,7 @@ export const Styles = (isDark: boolean) => { Platform.OS === 'ios' ? 'Avenir Medium' : 'fonts/poppins_regular.otf', }, Colors: { + background: isDark ? '#1C1C1E' : '#FFFFFF', heading: isDark ? '#9747FF' : '#9747FF', title: isDark ? '#FFFFFF' : '#000000', subtitle: isDark ? '#9A9A9A' : '#BEBEBE', diff --git a/example/src/pages/inbox/InboxStyled.tsx b/example/src/pages/inbox/InboxStyled.tsx index a420dc9..570dc67 100644 --- a/example/src/pages/inbox/InboxStyled.tsx +++ b/example/src/pages/inbox/InboxStyled.tsx @@ -20,6 +20,7 @@ const InboxStyled = () => { return { brandId: Env.brandId, + backgroundColor: styles.Colors.background, tabIndicatorColor: styles.Colors.action, tabStyle: { selected: { diff --git a/example/src/pages/preferences/PreferencesStyled.tsx b/example/src/pages/preferences/PreferencesStyled.tsx index 55fb96a..cb1b622 100644 --- a/example/src/pages/preferences/PreferencesStyled.tsx +++ b/example/src/pages/preferences/PreferencesStyled.tsx @@ -13,6 +13,7 @@ const PreferencesStyled = () => { return { brandId: Env.brandId, + backgroundColor: styles.Colors.background, sectionTitleFont: { family: styles.Fonts.heading, size: styles.TextSizes.heading, diff --git a/ios/CourierInboxReactNativeManager.swift b/ios/CourierInboxReactNativeManager.swift index 93ec2b1..35e9591 100644 --- a/ios/CourierInboxReactNativeManager.swift +++ b/ios/CourierInboxReactNativeManager.swift @@ -46,6 +46,14 @@ class CourierInboxView : UIView { let lightTheme = theme?["light"] as? NSDictionary let darkTheme = theme?["dark"] as? NSDictionary + let lightBgColor = (lightTheme?["backgroundColor"] as? String)?.toColor() + let darkBgColor = (darkTheme?["backgroundColor"] as? String)?.toColor() + if let bgColor = traitCollection.userInterfaceStyle == .dark ? darkBgColor ?? lightBgColor : lightBgColor ?? darkBgColor { + self.backgroundColor = bgColor + } else { + self.backgroundColor = nil + } + let courierInbox = CourierInbox( canSwipePages: self.canSwipePages, lightTheme: lightTheme?.toInboxTheme() ?? .defaultLight, diff --git a/ios/CourierPreferencesReactNativeManager.swift b/ios/CourierPreferencesReactNativeManager.swift index e214fb7..2df60c9 100644 --- a/ios/CourierPreferencesReactNativeManager.swift +++ b/ios/CourierPreferencesReactNativeManager.swift @@ -44,6 +44,14 @@ class CourierPreferencesView : UIView { let lightTheme = theme?["light"] as? NSDictionary let darkTheme = theme?["dark"] as? NSDictionary + let lightBgColor = (lightTheme?["backgroundColor"] as? String)?.toColor() + let darkBgColor = (darkTheme?["backgroundColor"] as? String)?.toColor() + if let bgColor = traitCollection.userInterfaceStyle == .dark ? darkBgColor ?? lightBgColor : lightBgColor ?? darkBgColor { + self.backgroundColor = bgColor + } else { + self.backgroundColor = nil + } + let courierPreferences = CourierPreferences( mode: mode?.toMode() ?? .channels(CourierUserPreferencesChannel.allCases), lightTheme: lightTheme?.toPreferencesTheme() ?? .defaultLight, diff --git a/src/models/CourierInboxTheme.tsx b/src/models/CourierInboxTheme.tsx index b0e2ff9..4b25338 100644 --- a/src/models/CourierInboxTheme.tsx +++ b/src/models/CourierInboxTheme.tsx @@ -48,6 +48,7 @@ export interface CourierArchivingSwipeActionStyle { export interface CourierInboxTheme { brandId?: string; + backgroundColor?: string; tabIndicatorColor?: string; tabStyle?: CourierInboxTabStyle; readingSwipeActionStyle?: CourierReadingSwipeActionStyle; diff --git a/src/models/CourierPreferencesTheme.tsx b/src/models/CourierPreferencesTheme.tsx index 896d648..23ee8f1 100644 --- a/src/models/CourierPreferencesTheme.tsx +++ b/src/models/CourierPreferencesTheme.tsx @@ -18,6 +18,7 @@ export type CourierPreferencesMode = export interface CourierPreferencesTheme { brandId?: string; + backgroundColor?: string; loadingIndicatorColor?: string; sectionTitleFont?: CourierFont; topicTitleFont?: CourierFont; From 670451af789dda1f02777f14e6bd1e5a2ce4f5e7 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 7 May 2026 21:24:11 +0000 Subject: [PATCH 4/5] fix: use multiGet/multiSet instead of non-existent getMany/setMany on AsyncStorage --- example/src/AuthPreferences.ts | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/example/src/AuthPreferences.ts b/example/src/AuthPreferences.ts index cd71387..ed0a2ae 100644 --- a/example/src/AuthPreferences.ts +++ b/example/src/AuthPreferences.ts @@ -25,7 +25,7 @@ export interface AuthPreferencesData { } export async function loadAuthPreferences(): Promise { - const results = await AsyncStorage.getMany([ + const pairs = await AsyncStorage.multiGet([ KEYS.environment, KEYS.userId, KEYS.tenantId, @@ -36,6 +36,11 @@ export async function loadAuthPreferences(): Promise { KEYS.inboxWebSocketUrl, ]); + const results: Record = {}; + for (const [key, value] of pairs) { + results[key] = value; + } + return { environment: (results[KEYS.environment] as CourierEnvironment) ?? @@ -54,19 +59,20 @@ export async function loadAuthPreferences(): Promise { export async function saveAuthPreferences( data: Partial ): Promise { - const entries: Record = {}; + const pairs: [string, string][] = []; if (data.environment !== undefined) - entries[KEYS.environment] = data.environment; - if (data.userId !== undefined) entries[KEYS.userId] = data.userId; - if (data.tenantId !== undefined) entries[KEYS.tenantId] = data.tenantId; - if (data.apiKey !== undefined) entries[KEYS.apiKey] = data.apiKey; - if (data.restUrl !== undefined) entries[KEYS.restUrl] = data.restUrl; - if (data.graphqlUrl !== undefined) entries[KEYS.graphqlUrl] = data.graphqlUrl; + pairs.push([KEYS.environment, data.environment]); + if (data.userId !== undefined) pairs.push([KEYS.userId, data.userId]); + if (data.tenantId !== undefined) pairs.push([KEYS.tenantId, data.tenantId]); + if (data.apiKey !== undefined) pairs.push([KEYS.apiKey, data.apiKey]); + if (data.restUrl !== undefined) pairs.push([KEYS.restUrl, data.restUrl]); + if (data.graphqlUrl !== undefined) + pairs.push([KEYS.graphqlUrl, data.graphqlUrl]); if (data.inboxGraphqlUrl !== undefined) - entries[KEYS.inboxGraphqlUrl] = data.inboxGraphqlUrl; + pairs.push([KEYS.inboxGraphqlUrl, data.inboxGraphqlUrl]); if (data.inboxWebSocketUrl !== undefined) - entries[KEYS.inboxWebSocketUrl] = data.inboxWebSocketUrl; - if (Object.keys(entries).length > 0) { - await AsyncStorage.setMany(entries); + pairs.push([KEYS.inboxWebSocketUrl, data.inboxWebSocketUrl]); + if (pairs.length > 0) { + await AsyncStorage.multiSet(pairs); } } From cbb1eb002ae434982867fd85c1fa4c87b8c1adc7 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 7 May 2026 21:27:48 +0000 Subject: [PATCH 5/5] chore: bump version to 5.7.1 --- android/src/main/java/com/courierreactnative/Utils.kt | 2 +- ios/CourierReactNativeDelegate.m | 2 +- ios/CourierReactNativeEventEmitter.swift | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/src/main/java/com/courierreactnative/Utils.kt b/android/src/main/java/com/courierreactnative/Utils.kt index 9885df3..bd53067 100644 --- a/android/src/main/java/com/courierreactnative/Utils.kt +++ b/android/src/main/java/com/courierreactnative/Utils.kt @@ -15,7 +15,7 @@ import com.facebook.react.modules.core.DeviceEventManagerModule import com.google.gson.GsonBuilder internal object Utils { - val COURIER_AGENT = CourierAgent.ReactNativeAndroid(version = "5.7.0") + val COURIER_AGENT = CourierAgent.ReactNativeAndroid(version = "5.7.1") } internal fun ReactContext.sendEvent(eventName: String, value: Any?) { diff --git a/ios/CourierReactNativeDelegate.m b/ios/CourierReactNativeDelegate.m index 484a55a..ec9685e 100644 --- a/ios/CourierReactNativeDelegate.m +++ b/ios/CourierReactNativeDelegate.m @@ -33,7 +33,7 @@ - (id)init { if (self) { // Set the user agent - Courier.agent = [CourierAgent reactNativeIOS:@"5.7.0"]; + Courier.agent = [CourierAgent reactNativeIOS:@"5.7.1"]; // Register for remote notifications UIApplication *app = [UIApplication sharedApplication]; diff --git a/ios/CourierReactNativeEventEmitter.swift b/ios/CourierReactNativeEventEmitter.swift index ce9dee3..01fb789 100644 --- a/ios/CourierReactNativeEventEmitter.swift +++ b/ios/CourierReactNativeEventEmitter.swift @@ -14,7 +14,7 @@ internal class CourierReactNativeEventEmitter: RCTEventEmitter { // Set the user agent // Used to know the platform performing requests - Courier.agent = CourierAgent.reactNativeIOS("5.7.0") + Courier.agent = CourierAgent.reactNativeIOS("5.7.1") } diff --git a/package-lock.json b/package-lock.json index 586c24a..f38f7b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@trycourier/courier-react-native", - "version": "5.7.0", + "version": "5.7.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@trycourier/courier-react-native", - "version": "5.7.0", + "version": "5.7.1", "license": "MIT", "dependencies": { "react-native-toast-message": "^2.2.0" diff --git a/package.json b/package.json index c3a63e6..6332627 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@trycourier/courier-react-native", - "version": "5.7.0", + "version": "5.7.1", "description": "Inbox, Push Notifications, and Preferences for React Native", "main": "lib/commonjs/index", "module": "lib/module/index",