braze-inc / braze-flutter-sdk

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

[Feature]: Rich push notifications, push stories #50

Closed Mik77o closed 10 months ago

Mik77o commented 1 year ago

We need to configure push stories. We have already configured rich push notifications according to the documentation: https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/push_notifications/customization/rich_notifications/#configuring-the-service-extension-to-work-with-braze. We try to configure push stories according to this documentation: https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/push_notifications/push_story/. Does one configuration affect the other? It would be great to add more detailed documentation to configure these things in Flutter.

hokstuff commented 1 year ago

Hi @Mik77o,

To configure Rich Push and Push Stories into your iOS application, you will have to do it in the native iOS layer, like in the docs you linked. The configuration of one of them does not affect the other, so to add in functionality for both, you will need to configure each one separately.

If you are using a recent version of the Flutter SDK which uses the Braze Swift SDK, the formal docs are going to be launched publicly very soon, meaning that the docs linked above are actually referencing the legacy AppboyKit SDK. In the meantime while we prepare to launch our official Braze public Swift docs, you can reference these technical Swift SDK docs to configure Rich Push and Push Stories. Hope this is helpful - if you have further questions feel free to reach out to our Support team to go in more depth around details of your integration.

Thanks!

Mik77o commented 1 year ago

@hokstuff Thank you for the quick reply! I will use this: https://braze-inc.github.io/braze-swift-sdk/tutorials/braze/b3-push-stories/. :)

Mik77o commented 1 year ago

@hokstuff In the third step here: https://braze-inc.github.io/braze-swift-sdk/tutorials/braze/b3-push-stories/, there is a mention of BrazePushStory. How to access this module?

hokstuff commented 1 year ago

Since Flutter uses Cocoapods under the hood, you will need to import BrazePushStory by adding it to your Podfile (to the Content Extension target), similar to the example shown here.

techouse commented 1 year ago

And in cocoapods you will need to statically link it as well, i.e.

target 'NotificationContentExtension' do
  use_frameworks! :linkage => :static

  pod 'BrazePushStory', '~> 5.12'
end
Mik77o commented 1 year ago

@hokstuff @techouse Thank you for your comments! I was able to send the test push story 🚀 Is there any way to fix this top padding? If I'm not mistaken this content is a bit clipped.

IMG_0004

hokstuff commented 1 year ago

Hi @Mik77o,

I'm glad you were able to get push stories working! I'm not sure what you were expecting, but the screenshot above looks as-expected to me and not clipped on the top. Can you contact support@braze.com and link this issue with what you expected from the assets you uploaded, and they can test in our internal sample apps to determine if the behavior is as-designed or if there is some other issue with it?

Thanks!

Mik77o commented 1 year ago

@hokstuff We'll test it for different assets and if the problem I wrote about is present, I'll send it to the email address provided by you. Thanks!

gbassipxl commented 12 months ago

Is there any chance you could include all the iOS dependencies (like BrazePushStory) in the plugin? I understand we need to do some native integration, but we are already doing it for all the other dependencies anyway. At least this way we wouldn't need to worry about dependency compatibility.

The same goes for the SDWebImage pod for IAM included in the example app but not in the documentation: https://github.com/braze-inc/braze-flutter-sdk/blob/master/example/ios/Podfile#L34

When I include BrazePushStory in the Podfile (with or without static linking) I get a duplicate symbols error: 138 duplicate symbols for architecture arm64

If instead I include the braze-swift-sdk through SPM I can get it to run, but either way it seems that all this native dependency handling could be done by braze_plugin.

Thanks in advance! 😃

gbassipxl commented 12 months ago

When I include BrazePushStory in the Podfile (with or without static linking) I get a duplicate symbols error: 138 duplicate symbols for architecture arm64

If instead I include the braze-swift-sdk through SPM I can get it to run, but either way it seems that all this native dependency handling could be done by braze_plugin.

Never mind this issue, I realised that I had to change the target on the Podfile. But I still leave the question as a feature request in order to lower the risk of having inconsistent behaviour caused by mismatching dependency versions. It's tricky to have future maintainers of a Flutter project aware about special cases on the native side.

Thanks again!

hokstuff commented 10 months ago

Hi @gbassipxl,

To respond to your feature request, we wanted to omit optional frameworks like BrazePushStory and BrazeNotificationService from the Flutter braze_plugin to avoid bloating the dependencies for host apps that don't wish to use those features. I am also not sure if making that change would solve the issue with duplicate symbols, and it seems like you have been able to solve that on your end. Additionally, as you said, there will already need to be some native work done in order to implement Push Stories / Rich Push, so we decided to go with the current implementation.

Hope that explains things a bit!

hokstuff commented 10 months ago

I am going to close out this thread since it appears that the issue in the original post has been resolved. If you continue to face issues, feel free to contact our Support team at support@braze.com and we can help investigate any issues further.

Thanks all!