-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: Push Notification callbacks in the Dart layer #14
Comments
Hi @CassiusPacheco, Thanks for filing this and adding information about other resources. Currently, we support push notifications on Flutter via the native layer. This means that in order to respond to run custom code once Braze receives a push notification, you would need to add code into your native iOS and Android parts of your Flutter app as described in the docs. Let me know if this helps or if you have any other concerns! |
Hey @hokstuff, thanks for coming back to me. I'm aware I would have to write it myself, in fact I had to do it in order to solve my problem, however it'd be best if your lib did it, since, in my opinion, a Push Notification library is responsible for offering callbacks for it, like Firebase does. Honestly had I known of this limitation before I would have voted against using Braze in favour of Firebase. Anyway, I leave my feedback to you. Feel free to close the issue. Thanks |
Hi @CassiusPacheco, Thanks for your feedback about this. We currently do have a product request to move any logic from the native layers into the Dart layer to make integrating our Flutter SDK as frictionless as possible, and that includes any code around push. Thank you for your suggestion - we have added the details of this thread to our internal request. Thanks! |
Hello @hokstuff . Given the Flutter plugin is still using SDK 17, I understand Flutter is not really a priority for Braze, is that correct? |
Hi @RTodorov, The Flutter SDK is a priority at Braze and we have several exciting features planned and in development for the SDK. One thing to note is that not every native SDK update will make it into the Flutter SDK at the same time as the native counterparts, but we do make sure critical bugfixes and features releases are released right away. We are working on prepping the next version of the SDK which will also update to use the Android SDK version. Thanks for your patience! |
Hi @hokstuff. The native notification implementation is not compatible with the way notifications are handled in Flutter. FirebaseMessaging callbacks don't work correctly, and Background notifications (at least on Android), don't work if the native Braze Handler isn't implemented on Android, which is a problem, because we have to bypass/patch it to be able to use it in Flutter side. I think this is because the Payload of the Braze notifications does not follow the standard defined by Firebase (if I am not wrong the notification property directly is not sent by the Braze API). Ref: https://firebase.google.com/docs/cloud-messaging/concept-options Could you at least follow the defined standard? Currently it complicates the implementation with Flutter a lot. I also don't understand why you don't send that property, since you are supporting Silent Notifications/ Data Notifications that sent everything in the Data property (without the notification property), so by default the Notification property should be there. |
Hi @julianfalcionelli , The core Android Braze SDK receives strictly data messages over Firebase since in many cases, a notification message is handled by Firebase (and not forwarded to the SDK) and displayed automatically. However to properly do things like analytics, deeplinking, etc. with the flexibility we need, Braze instead uses data messages and encodes the displayed content of the notification into the data portion as well. Thus, there is no "notification message" as Firebase defines it in the actual payload sent from Firebase, only the data message portion. There are data types, like push stories, inline image push, etc. that Firebase doesn't offer that Braze does so sending notification messages isn't viable. I hope this clears up that aspect of your question. Thanks, |
@radixdev I fully understand that you have to intercept the notification so that certain functionalities such as analytics, attributions and others work correctly, but I do not understand why coupling the implementation to the notification rendering logic, you can capture the notifications and their information without having to take charge of visualizing them and follow the standard used by Firebase and other platforms. |
Hi @julianfalcionelli , Just to clarify, the desired API interface here would be that Braze would continue to handle the rendering logic but that the Flutter layer would get a stream of that notification information as it arrives? In that API interface, the integrator wouldn't have to touch native code, would receive the notification data, and would have all the benefits of the core Braze SDKs doing notification handling. Is that correct? |
@radixdev We are running into this issue as well. The SDK currently gets the notification data into the native layer but it does not move the data into the Dart layer for us to use in Flutter. Thus leaving that gap for us to fill in with our own native code. It would be hugely beneficial for the SDK to support this. |
HI @terrancej , We're currently working on getting this ready and will update this issue with progress. Thank you for your patience. |
@radixdev @hokstuff While fixing this issue could you guys please share a sample of native code for a workaround meanwhile? When we send our push notification from Braze we get |
Hi all, Just to update this thread - Our team is working on a longer term solution around this feature request in each of the native Braze SDKs to create an API interface that can be easily used across all of our "wrapper" SDKs (e.g. Flutter, React Native, Unity, etc). We have had similar feature requests across each of these codebases and feel a more holistic approach would be best solution for consistency and maintenance. This also means that the solution will take some more time - thanks for your patience. It sounds like the issue you are facing is specific to your setup while using both our SDK and a separate SDK (Firebase). We will need more information on your setup, and it seems to be a tangential topic than the original post. The workaround described above requires handling the push payload in each of the native layers. We currently don't have sample code around this but have that request on our roadmap. For your specific situation, can you contact support@braze.com with your integration code and the specific issues you are facing? It would also be helpful to converse on a separate thread instead of this one since they have different topics. Thanks! |
Do we have an expected eta for when should we expect this release? From the time of writing it's been 8 months now We're about to adopt braze via Flutter as well and would want to eliminate as much native code changes as possible |
Hi @mark-buot, As an update - We have released this feature in our React Native SDK, and we have allocated work to implement the complementary feature on the Flutter SDK. At the moment, we are still planning out what this looks like and don't have a specific ETA for this. However, we are hoping to implement a solution within the quarter. Thanks! |
Hello. |
Hi @Galti, We currently have this feature planned for this half and are planning to start development on it shortly. We will keep this thread notified with any updates. Thanks for your patience! |
Hi @CassiusPacheco @RTodorov @julianfalcionelli @terrancej @Kirill-Karmazin-IDT @mark-buot @Galti, I'm pleased to announce that we have released Braze Flutter SDK version 9.0.0 which adds an API to subscribe to Braze Push notification events directly in the Dart layer! If you have any further questions or comments about this feature, feel free to let us know on this thread or by contacting your CSM / our Support team. Thank you all for your patience! |
Thank you @hokstuff we'll try it out! |
Hello,
as far as I understand there's currently no way of getting callbacks for when Braze receives a push notification. We want to implement some custom code and routing based on the data.
Similar to
setBrazeInAppMessageCallback
andsetBrazeContentCardsCallback
that you have implemented.Another example is Firebase Messaging exposes streams for all types of notifications received.
The text was updated successfully, but these errors were encountered: