Checklist
Description
First of all, thanks for the great package and the work on the Flutter SDK.
I noticed an inconsistency in the behavior of the KlaviyoSDK().onPushNotification listener between iOS and Android.
Current Behavior
iOS
KlaviyoSDK().onPushNotification is triggered as expected for Klaviyo push notifications.
Android
KlaviyoSDK().onPushNotification is never triggered. Instead, all incoming messages (including Klaviyo messages) are only received through:
FirebaseMessaging.onMessage
FirebaseMessaging.onMessageOpenedApp
This means on Android I need to manually detect whether a message is from Klaviyo and handle it inside the Firebase listeners, while on iOS I handle Klaviyo notifications through onPushNotification.
Expected Behavior
Ideally, KlaviyoSDK().onPushNotification should behave consistently across both platforms, or the platform-specific behavior should be clearly documented.
Question
Is this intended behavior on Android?
If yes, it would be very helpful to mention this difference explicitly in the documentation, since currently it seems like the listener should work the same way on both platforms.
Example
if (Platform.isAndroid) {
FirebaseMessaging.onMessage.listen((message) {
if (message.data.isKlaviyoNotification) {
// Handle Klaviyo notification manually
} else {
// Handle regular Firebase notification
}
});
FirebaseMessaging.onMessageOpenedApp.listen((message) {
// Handle opened notification
});
} else if (Platform.isIOS) {
KlaviyoSDK().onPushNotification.listen((event) {
if (event['type'] == 'push_notification_opened') {
// Handle opened notification
}
});
}
Additional Context
Because of this difference, notification handling logic needs to be split by platform, which adds extra complexity in cross-platform Flutter apps.
### Expected behavior
```markdown
KlaviyoSDK().onPushNotification.listen should handle messages on both platforms
Actual behavior
KlaviyoSDK().onPushNotification.listen just works on iOS
Steps to reproduce
Send message through firebase and klaviyo on android and then ios
The Klaviyo Flutter SDK version information
0.1.0
Flutter and Dart version
Flutter 3.38.4, Dart 3.10.3
Device and OS information
Nothing Phone, Iphone 14 Pro Max
Checklist
masterbranch or latest release of this package.Description
First of all, thanks for the great package and the work on the Flutter SDK.
I noticed an inconsistency in the behavior of the
KlaviyoSDK().onPushNotificationlistener between iOS and Android.Current Behavior
iOS
KlaviyoSDK().onPushNotificationis triggered as expected for Klaviyo push notifications.Android
KlaviyoSDK().onPushNotificationis never triggered. Instead, all incoming messages (including Klaviyo messages) are only received through:FirebaseMessaging.onMessageFirebaseMessaging.onMessageOpenedAppThis means on Android I need to manually detect whether a message is from Klaviyo and handle it inside the Firebase listeners, while on iOS I handle Klaviyo notifications through
onPushNotification.Expected Behavior
Ideally,
KlaviyoSDK().onPushNotificationshould behave consistently across both platforms, or the platform-specific behavior should be clearly documented.Question
Is this intended behavior on Android?
If yes, it would be very helpful to mention this difference explicitly in the documentation, since currently it seems like the listener should work the same way on both platforms.
Example
Additional Context
Because of this difference, notification handling logic needs to be split by platform, which adds extra complexity in cross-platform Flutter apps.
Actual behavior
Steps to reproduce
The Klaviyo Flutter SDK version information
0.1.0
Flutter and Dart version
Flutter 3.38.4, Dart 3.10.3
Device and OS information
Nothing Phone, Iphone 14 Pro Max