Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are we doing this
As part of this ticket, I've added couple functions that should help to use
subscribeToContentCards
functional that is not been implemented there beforeDescribe
So the main idea is to subscribe to Content Cards and then have an ability to dismiss it, the subscription itself is working fine but when I've started to combine web implementation with mobile it become harder. That's why we need to hold cards in the plugin as well cuz I didn't find a way how to dismiss Cards by ID. Moreover, there are a couple of card types that we can follow and parse back. Every time when I've tried to parse cards back to JS object it keep saying that this "Object should be a type Card" from braze sdk JS implementation.
As you can see, I've also added a comment which you can follow to try to use converting objects as well.
How to use
requestContentCardsRefresh
- to get a new content cardssubscribeToContentCardsUpdates
- subscribe to content cards(you need to look onto this method cuz if cards will be parsed in wrong way there can be an error which also probably better to handle)logContentCardDismissed
- pass content card id to dismiss content cardExamples
On the UI side, if you want to use both mobile and web implementation, you need to create a wrapper that will have this as well. Example
Also if you want to have a braze plugin implementation, you can use something like:
main plugin abstraction:
web plugin implementation: