braze-inc / braze-flutter-sdk

Public repo for the Braze Flutter SDK
Other
15 stars 29 forks source link

[Feature] Can braze support In App Message Clicked Listener ? #33

Closed zkjxx1548 closed 1 year ago

zkjxx1548 commented 1 year ago

Background Flutter: 2.10.5 braze_plugin: ^2.6.1

We want to use deep link in the braze In App Message buttons. And Parse the deep link when users click the In App Message button.

We used the subscribeToInAppMessages to handle the case when user receives an In App Message in flutter. But there doesn't seem to be a way to listen to the click event.

Any suggestions?

hokstuff commented 1 year ago

Hi @zkjxx1548,

To log that an in-app message button is clicked in the Flutter layer, you can use logInAppMessageButtonClicked .

If you wish to add support for deeplinking, you will need to integrate deep links in the native iOS and Android layers of your application.

zkjxx1548 commented 1 year ago

We found:

  1. If we integrate In App Message in Android
  2. And use Custom manager listener to handle the case when click the In App Message button.

result: subscribeToInAppMessages in Flutter layer can not work.

Can flutter-braze dependency itself support In App Message Clicked listener ?

hokstuff commented 1 year ago

Hi @zkjxx1548,

Are you running into this issue on both iOS and Android?

On Android, when creating a custom in-app message manager listener, it overwrites any existing default one. Can you try adding a call to BrazePlugin.processInAppMessage(inAppMessage) inside your beforeInAppMessageDisplayed method like in our sample here? This should pass the in-app message from the Android native layer to the Flutter layer to be processed.

zkjxx1548 commented 1 year ago

Only running into android. Thanks for reply. I will try it.