Skip to content

Commit

Permalink
Release Flutter SDK version 2.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hokstuff committed Nov 2, 2022
1 parent 3434240 commit 5276be6
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 13 deletions.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"java.configuration.updateBuildConfiguration": "automatic"
"java.configuration.updateBuildConfiguration": "automatic",
"lldb.library": "/Applications/Xcode-14.0.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB",
"githubPullRequests.ignoredPullRequestBranches": [
"develop"
]
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 2.6.1

##### Added
- Adds support to replay the `onEvent` method for queued in-app messages and content cards when subscribing via streams.
- This feature must be enabled by setting `replayCallbacksConfigKey: true` in `customConfigs` for the `BrazePlugin`.

##### Changed
- The native Android bridge uses [Braze Android SDK 23.3.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#2330).
- Updates the parameter type for `subscribeToInAppMessages()` and `subscribeToContentCards()` to accept a `Function` instead of a `void`.

## 2.6.0

##### Breaking
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ android {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "com.appboy:android-sdk-ui:23.2.0"
implementation "com.appboy:android-sdk-ui:23.3.0"
}
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.multidex:multidex:2.0.0'

implementation "com.appboy:android-sdk-ui:23.2.0"
implementation "com.appboy:android-sdk-ui:23.3.0"
implementation "com.google.firebase:firebase-messaging:+"
}
apply plugin: 'com.google.gms.google-services'
2 changes: 2 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ class BrazeFunctionsState extends State<BrazeFunctions> {
inAppMessageStreamSubscription = _braze
.subscribeToInAppMessages((BrazeInAppMessage inAppMessage) {
_inAppMessageReceived(inAppMessage, prefix: "STREAM");
return;
});
ScaffoldMessenger.of(context).showSnackBar(new SnackBar(
content: new Text("Listening to in-app message stream. "
Expand Down Expand Up @@ -344,6 +345,7 @@ class BrazeFunctionsState extends State<BrazeFunctions> {
contentCardsStreamSubscription = _braze.subscribeToContentCards(
(List<BrazeContentCard> contentCards) {
_contentCardsReceived(contentCards, prefix: "STREAM");
return;
});
ScaffoldMessenger.of(context).showSnackBar(new SnackBar(
content: new Text("Listening to content cards stream. "
Expand Down
2 changes: 1 addition & 1 deletion ios/braze_plugin.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
Pod::Spec.new do |s|
s.name = 'braze_plugin'
s.version = '2.6.0'
s.version = '2.6.1'
s.summary = 'Braze plugin for Flutter.'
s.description = <<-DESC
Braze plugin for Flutter.
Expand Down
26 changes: 18 additions & 8 deletions lib/braze_plugin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,32 @@ class BrazePlugin {
/// Subscribes to the stream of in-app messages and calls [onEvent] when it
/// receives an in-app message.
StreamSubscription subscribeToInAppMessages(
void onEvent(BrazeInAppMessage inAppMessage)) {
Function onEvent(BrazeInAppMessage inAppMessage)) {
if (_replayCallbacksConfigEnabled() && _queuedInAppMessages.isNotEmpty) {
print(
"Replaying stream onEvent for previously queued Braze in-app messages.");
_queuedInAppMessages.forEach((message) => onEvent(message));
_queuedInAppMessages.clear();
}

StreamSubscription subscription =
inAppMessageStreamController.stream.listen((inAppMessage) {
onEvent(inAppMessage);
});
inAppMessageStreamController.stream.listen(onEvent);
return subscription;
}

/// Subscribes to the stream of content cards and calls [onEvent] when it
/// receives the list of content cards.
StreamSubscription subscribeToContentCards(
void onEvent(List<BrazeContentCard> contentCard)) {
Function onEvent(List<BrazeContentCard> contentCard)) {
if (_replayCallbacksConfigEnabled() && _queuedContentCards.isNotEmpty) {
print(
"Replaying stream onEvent for previously queued Braze content cards.");
onEvent(_queuedContentCards);
_queuedContentCards.clear();
}

StreamSubscription subscription =
contentCardsStreamController.stream.listen((contentCard) {
onEvent(contentCard);
});
contentCardsStreamController.stream.listen(onEvent);
return subscription;
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: braze_plugin
description: This is the Braze plugin for Flutter. Effective marketing automation is an essential part of successfully scaling and managing your business.
version: 2.6.0
version: 2.6.1
homepage: https://www.braze.com/
repository: https://github.com/braze-inc/braze-flutter-sdk

Expand Down

0 comments on commit 5276be6

Please sign in to comment.