From 0b21cf9e63aa57061db5c72a8ff108b72101346b Mon Sep 17 00:00:00 2001 From: "courier-android-automation[bot]" Date: Wed, 27 May 2026 19:46:01 +0000 Subject: [PATCH 1/2] Bump courier-android to 6.1.0 --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 6dee0d5..9122c04 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -111,7 +111,7 @@ dependencies { implementation 'com.google.code.gson:gson:2.11.0' // Courier Core SDK - api 'com.github.trycourier:courier-android:6.0.1' + api 'com.github.trycourier:courier-android:6.1.0' api 'androidx.recyclerview:recyclerview:1.3.2' // Firebase Messaging (needed to resolve RemoteMessage from Courier SDK APIs) From d73ed597bb8b33a0c2f5aa073ee43e2149cb1500 Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Wed, 27 May 2026 15:54:38 -0400 Subject: [PATCH 2/2] chore: bump to 6.0.2 and align ExampleService with courier-android 6.1.0 Update CourierPushNotificationIntent API usage and notification flow. Co-authored-by: Cursor --- .../main/java/com/courierreactnative/Utils.kt | 2 +- example-085/android/app/build.gradle | 2 +- .../ExampleService.kt | 85 +++++++++---------- ios/CourierReactNativeDelegate.m | 2 +- ios/CourierReactNativeEventEmitter.swift | 2 +- package-lock.json | 4 +- package.json | 2 +- 7 files changed, 46 insertions(+), 53 deletions(-) diff --git a/android/src/main/java/com/courierreactnative/Utils.kt b/android/src/main/java/com/courierreactnative/Utils.kt index 1a42264..3a32b32 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 = "6.0.1") + val COURIER_AGENT = CourierAgent.ReactNativeAndroid(version = "6.0.2") } internal fun ReactContext.sendEvent(eventName: String, value: Any?) { diff --git a/example-085/android/app/build.gradle b/example-085/android/app/build.gradle index 77d2319..2f7b33b 100644 --- a/example-085/android/app/build.gradle +++ b/example-085/android/app/build.gradle @@ -84,7 +84,7 @@ android { applicationId "com.courierreactnativeexample.app" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 43 + versionCode 44 versionName "1.0" } signingConfigs { diff --git a/example-085/android/app/src/main/java/com/courierreactnativeexample/ExampleService.kt b/example-085/android/app/src/main/java/com/courierreactnativeexample/ExampleService.kt index 69051b5..d5e940c 100644 --- a/example-085/android/app/src/main/java/com/courierreactnativeexample/ExampleService.kt +++ b/example-085/android/app/src/main/java/com/courierreactnativeexample/ExampleService.kt @@ -20,57 +20,50 @@ import com.google.firebase.messaging.RemoteMessage // Courier React Native SDK — https://www.courier.com/docs/sdk-libraries/react-native/ // Courier Android SDK — https://www.courier.com/docs/sdk-libraries/android // Android notifications — https://developer.android.com/develop/ui/views/notifications/build-notification -// -// Requires Firebase Messaging dependency in your app/build.gradle: -// implementation(platform("com.google.firebase:firebase-bom:")) -// implementation("com.google.firebase:firebase-messaging") -class ExampleService : FirebaseMessagingService() { +class ExampleService: FirebaseMessagingService() { + + override fun onMessageReceived(message: RemoteMessage) { + super.onMessageReceived(message) + + // --- Demo notification code (replace with your own for production) ----------- + // + // CourierPushNotificationIntent is a convenience wrapper that bundles the + // RemoteMessage into a PendingIntent. When the user taps the notification, + // Courier can fire onPushNotificationClicked and track a CLICKED event. + // In your own app you can build the PendingIntent yourself and call + // Courier.shared.client.tracking.postTrackingUrl(...) on tap instead. + val notificationIntent = CourierPushNotificationIntent( + context = this, + target = MainActivity::class.java, + payload = message + ) - override fun onMessageReceived(message: RemoteMessage) { - super.onMessageReceived(message) + // presentNotification is a Courier helper that posts a basic notification + // via NotificationManagerCompat. It is fine for testing but not customizable + // enough for production — use NotificationCompat.Builder directly: + // https://developer.android.com/develop/ui/views/notifications/build-notification + notificationIntent.presentNotification( + title = message.data["title"] ?: message.notification?.title, + body = message.data["body"] ?: message.notification?.body, + ) - // Required — Tells the Courier SDK a push was delivered. - // Behind the scenes this posts the trackingUrl from the FCM data payload - // as a DELIVERED event so delivery analytics appear in the Courier dashboard, - // and fires any onPushDelivered listeners registered from the JS layer. - Courier.onMessageReceived(message.data) + // Required — Tells the Courier SDK a push was delivered. + // Behind the scenes this posts the trackingUrl from the FCM data payload + // as a DELIVERED event so delivery analytics appear in the Courier dashboard, + // and fires any onPushDelivered listeners registered from the JS layer. + Courier.onMessageReceived(message.data) - // --- Demo notification code (replace with your own for production) ----------- - // - // CourierPushNotificationIntent is a convenience wrapper that bundles the - // RemoteMessage into a PendingIntent. When the user taps the notification, - // Courier can fire onPushNotificationClicked and track a CLICKED event. - // In your own app you can build the PendingIntent yourself and call - // Courier.shared.client.tracking.postTrackingUrl(...) on tap instead. - val notificationIntent = CourierPushNotificationIntent( - this, - 0, - MainActivity::class.java, - message - ) + } - // presentNotification is a Courier helper that posts a basic notification - // via NotificationManagerCompat. It is fine for testing but not customizable - // enough for production — use NotificationCompat.Builder directly: - // https://developer.android.com/develop/ui/views/notifications/build-notification - val title = message.data["title"] ?: message.notification?.title - val body = message.data["body"] ?: message.notification?.body + override fun onNewToken(token: String) { + super.onNewToken(token) - notificationIntent.presentNotification( - title, - body, - android.R.drawable.ic_dialog_info, - "Notification Service" - ) - } + // Required — Syncs this device's FCM token with Courier. + // Behind the scenes the SDK caches the token locally and uploads it to + // Courier linked to the currently signed-in user. If no user is signed in + // yet the token is held locally and synced on the next signIn() call. + Courier.onNewToken(token) - override fun onNewToken(token: String) { - super.onNewToken(token) + } - // Required — Syncs this device's FCM token with Courier. - // Behind the scenes the SDK caches the token locally and uploads it to - // Courier linked to the currently signed-in user. If no user is signed in - // yet the token is held locally and synced on the next signIn() call. - Courier.onNewToken(token) - } } diff --git a/ios/CourierReactNativeDelegate.m b/ios/CourierReactNativeDelegate.m index 47b7f9d..aa41e35 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:@"6.0.1"]; + Courier.agent = [CourierAgent reactNativeIOS:@"6.0.2"]; // Register for remote notifications UIApplication *app = [UIApplication sharedApplication]; diff --git a/ios/CourierReactNativeEventEmitter.swift b/ios/CourierReactNativeEventEmitter.swift index bd1fdbf..ff6cde7 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("6.0.1") + Courier.agent = CourierAgent.reactNativeIOS("6.0.2") } diff --git a/package-lock.json b/package-lock.json index 3d261d2..63e0817 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@trycourier/courier-react-native", - "version": "6.0.1", + "version": "6.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@trycourier/courier-react-native", - "version": "6.0.1", + "version": "6.0.2", "license": "MIT", "dependencies": { "react-native-toast-message": "^2.2.0" diff --git a/package.json b/package.json index 9270b4e..0157ed5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@trycourier/courier-react-native", - "version": "6.0.1", + "version": "6.0.2", "description": "Inbox, Push Notifications, and Preferences for React Native", "main": "lib/commonjs/index", "module": "lib/module/index",