Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Docs/3_PushNotifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,6 @@ class YourNotificationService : FirebaseMessagingService() {
override fun onMessageReceived(message: RemoteMessage) {
super.onMessageReceived(message)

// Notify the Courier SDK that a push was delivered
Courier.onMessageReceived(message.data)

// Create the PendingIntent that runs when the user taps the notification
// This intent targets your Activity and carries the original message payload
// TODO: Remove this if you'd like. This is mostly useful for demo purposes.
Expand All @@ -343,7 +340,10 @@ class YourNotificationService : FirebaseMessagingService() {
title = message.data["title"] ?: message.notification?.title,
body = message.data["body"] ?: message.notification?.body,
)


// Notify the Courier SDK that a push was delivered
Courier.onMessageReceived(message.data)

}

override fun onNewToken(token: String) {
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies {
implementation 'com.google.code.gson:gson:2.11.0'

// Courier Core SDK
api 'com.github.trycourier:courier-android:6.0.0'
api 'com.github.trycourier:courier-android:6.1.0'

// Firebase Messaging (needed to resolve RemoteMessage from Courier SDK APIs)
compileOnly 'com.google.firebase:firebase-messaging:23.4.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ open class CourierFlutterActivity : FlutterActivity() {
super.onCreate(savedInstanceState)

// Setup and run the agent
Courier.agent = CourierAgent.FlutterAndroid(version = "5.0.0")
Courier.agent = CourierAgent.FlutterAndroid(version = "5.0.1")
Courier.initialize(context)

// Handle system events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ open class CourierFlutterFragmentActivity : FlutterFragmentActivity() {
super.onCreate(savedInstanceState)

// Setup and run the agent
Courier.agent = CourierAgent.FlutterAndroid(version = "5.0.0")
Courier.agent = CourierAgent.FlutterAndroid(version = "5.0.1")
Courier.initialize(this)

// Handle system events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal class CourierPlugin : FlutterPlugin {
}

init {
Courier.agent = CourierAgent.FlutterAndroid(version = "5.0.0")
Courier.agent = CourierAgent.FlutterAndroid(version = "5.0.1")
}

override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ class ExampleService : FirebaseMessagingService() {
override fun onMessageReceived(message: RemoteMessage) {
super.onMessageReceived(message)

// 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 Dart layer.
Courier.onMessageReceived(message.data)

// --- Demo notification code (replace with your own for production) -----------
//
// CourierPushNotificationIntent is a convenience wrapper that bundles the
Expand All @@ -54,6 +48,12 @@ class ExampleService : FirebaseMessagingService() {
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 Dart layer.
Courier.onMessageReceived(message.data)

}

override fun onNewToken(token: String) {
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Demonstrates how to use the courier_flutter plugin.
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+30
version: 1.0.0+33

environment:
sdk: '>=3.3.0 <4.0.0'
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/CourierFlutterDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ open class CourierFlutterDelegate: FlutterAppDelegate {
super.init()

// Set the api agent version
Courier.agent = CourierAgent.flutterIOS("5.0.0")
Courier.agent = CourierAgent.flutterIOS("5.0.1")

// Handle notification registration
app.registerForRemoteNotifications()
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/CourierFlutterMethodHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class CourierFlutterMethodHandler: NSObject {

// Set the flutter ios user agent
// This ensures all the requests are tagged with this agent
Courier.agent = CourierAgent.flutterIOS("5.0.0")
Courier.agent = CourierAgent.flutterIOS("5.0.1")

}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: courier_flutter
description: Inbox, Push Notifications and Preferences for Flutter
version: 5.0.0
version: 5.0.1
homepage: https://courier.com

environment:
Expand Down
Loading