Skip to content

Commit

Permalink
Release Flutter SDK version 10.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hokstuff committed Apr 30, 2024
1 parent 34529d2 commit 01c6a83
Show file tree
Hide file tree
Showing 16 changed files with 294 additions and 66 deletions.
56 changes: 34 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
⚠️ In version 3.0.0, we changed the iOS bridge from AppboyKit, which is written in Objective-C, to the new [Swift SDK](https://github.com/braze-inc/braze-swift-sdk). If you are upgrading from a version below 3.0.0 to a version above 3.0.0, please read [the instructions](https://github.com/braze-inc/braze-flutter-sdk/blob/master/CHANGELOG.md#300) to ensure a smooth transition and backward compatibility.

## 10.0.0

##### Breaking
- Updates the native iOS bridge [from Braze Swift SDK 8.4.0 to 9.0.0](https://github.com/braze-inc/braze-swift-sdk/compare/8.4.0...9.0.0#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed).

##### Added
- Adds the `getDeviceId` method to replace `getInstallTrackingId`, which is now deprecated.

##### Fixed
- Fixes an issue where StrictMode DiskReadViolation was triggered on Android.
- Thanks @radivojeostojic for pointing this out.

## 9.0.0

##### Breaking
Expand Down Expand Up @@ -136,7 +148,7 @@
## 3.1.0

##### Breaking
- The native Android bridge uses [Braze Android SDK 24.2.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#2420).
- The native Android bridge uses [Braze Android SDK 24.2.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#2420).
- The native iOS bridge uses [Braze iOS SDK 5.9.0](https://github.com/braze-inc/braze-swift-sdk/blob/main/CHANGELOG.md#590).
- The minimum iOS deployment target is 11.0.

Expand Down Expand Up @@ -177,13 +189,13 @@
- 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).
- The native Android bridge uses [Braze Android SDK 23.3.0](https://github.com/braze-inc/braze-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
- The native Android bridge uses [Braze Android SDK 23.2.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#2320).
- The native Android bridge uses [Braze Android SDK 23.2.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#2320).
- The native iOS bridge uses [Braze iOS SDK 4.5.1](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#451).
- `process(inAppMessage)` is renamed to `processInAppMessage(inAppMessage)` in the iOS layer.
Expand All @@ -198,7 +210,7 @@
## 2.5.0
##### Breaking
- The native Android bridge uses [Braze Android SDK 21.0.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#2100).
- The native Android bridge uses [Braze Android SDK 21.0.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#2100).
- Removes `logContentCardsDisplayed()`. This method was not part of the recommended Content Cards integration and can be safely removed.
##### Added
Expand All @@ -210,7 +222,7 @@
## 2.4.0
##### Breaking
- The native Android bridge uses [Braze Android SDK 20.0.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#2000).
- The native Android bridge uses [Braze Android SDK 20.0.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#2000).
- Removes `setAvatarImageUrl()`.
##### Changed
Expand All @@ -219,7 +231,7 @@
## 2.3.0
##### Breaking
- The native Android bridge uses [Braze Android SDK 17.0.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#1700).
- The native Android bridge uses [Braze Android SDK 17.0.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#1700).
- The minimum supported Android SDK version is 19.
- Removes support for Android V1 Embedding APIs. Please reference [the Flutter migration guide](https://flutter.dev/docs/development/packages-and-plugins/plugin-api-migration) to update to the V2 APIs.
Expand All @@ -239,7 +251,7 @@
## 2.2.0
##### Breaking
- The native Android bridge uses [Braze Android SDK 16.0.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#1600).
- The native Android bridge uses [Braze Android SDK 16.0.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#1600).
- The native iOS bridge uses [Braze iOS SDK 4.4.0](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#440).
- Streamlines the Android integration process to not involve any manual writing of code to automatically register for sessions, in-app messages, or Content Card updates from the native SDK.
- To migrate, remove any manual calls to `registerActivityLifecycleCallbacks()`, `subscribeToContentCardsUpdates()`, and `setCustomInAppMessageManagerListener()`.
Expand All @@ -262,7 +274,7 @@
##### Breaking
- The native iOS bridge uses [Braze iOS SDK 4.3.2](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#432).
- The native Android bridge uses [Braze Android SDK 15.0.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#1500).
- The native Android bridge uses [Braze Android SDK 15.0.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#1500).
##### Added
- Adds `logContentCardsDisplayed()` to manually log an impression when displaying Content Cards in a custom UI.
Expand All @@ -277,7 +289,7 @@
- Passing through `null` as a value for user attributes is no longer supported.
- The only attribute that is able to be unset is `email` by passing in `null` into `setEmail`.
- The methods `logEvent` and `logPurchase` now take an optional `properties` parameter.
- The native Android bridge uses [Braze Android SDK 14.0.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#1400).
- The native Android bridge uses [Braze Android SDK 14.0.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#1400).
- The minimum supported Dart version is `2.12.0`.
##### Changed
Expand All @@ -287,7 +299,7 @@
##### Breaking
- The native iOS bridge uses [Braze iOS SDK 4.0.2](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#402).
- The native Android bridge uses [Braze Android SDK 13.1.2](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#1312).
- The native Android bridge uses [Braze Android SDK 13.1.2](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#1312).
- The minimum supported Flutter version is 1.10.0.
##### Added
Expand All @@ -297,7 +309,7 @@
## 1.4.0
##### Breaking
- The native Android bridge uses [Braze Android SDK 13.0.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#1300).
- The native Android bridge uses [Braze Android SDK 13.0.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#1300).
- The native iOS bridge uses [Braze iOS SDK 3.34.0](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#3340).
##### Added
Expand All @@ -309,7 +321,7 @@
## 1.3.0
##### Breaking
- The native Android bridge uses [Braze Android SDK 12.0.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#1200).
- The native Android bridge uses [Braze Android SDK 12.0.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#1200).
- The native iOS bridge uses [Braze iOS SDK 3.31.0](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#3310).
##### Added
Expand All @@ -327,7 +339,7 @@
## 1.1.0
##### Breaking
- The native Android bridge uses [Braze Android SDK 11.0.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#1100).
- The native Android bridge uses [Braze Android SDK 11.0.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#1100).
- The native iOS bridge uses [Braze iOS SDK 3.29.1](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#3291).
## 1.0.0
Expand All @@ -343,7 +355,7 @@
## 0.10.0
##### Breaking
- The native Android bridge uses [Braze Android SDK 8.1.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#810).
- The native Android bridge uses [Braze Android SDK 8.1.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#810).
- The native iOS bridge uses [Braze iOS SDK 3.26.0](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#3260).
##### Fixed
Expand All @@ -352,15 +364,15 @@
## 0.9.0
##### Breaking
- The native Android bridge uses [Braze Android SDK 7.0.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#700).
- The native Android bridge uses [Braze Android SDK 7.0.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#700).
- The native iOS bridge uses [Braze iOS SDK 3.22.0](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#3220).
## 0.8.0
##### Breaking
- The native iOS bridge uses [Braze iOS SDK 3.21.3](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#3213).
- The native Android bridge uses [Braze Android SDK 4.0.2](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#402).
- If you are using a custom `IInAppMessageManagerListener`, then you will need to define new methods added to that interface in [Braze Android SDK 4.0.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#400). See the `MainActivity.kt` file of our sample app for a reference example.
- The native Android bridge uses [Braze Android SDK 4.0.2](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#402).
- If you are using a custom `IInAppMessageManagerListener`, then you will need to define new methods added to that interface in [Braze Android SDK 4.0.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#400). See the `MainActivity.kt` file of our sample app for a reference example.
## 0.7.0
Expand All @@ -384,7 +396,7 @@
## 0.6.0
##### Changed
- The native Android bridge uses [Braze Android SDK 3.8.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#380).
- The native Android bridge uses [Braze Android SDK 3.8.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#380).
- Updated the native iOS bridge to [Braze iOS SDK 3.20.4](https://github.com/Appboy/appboy-ios-sdk/releases/tag/3.20.4).
## 0.5.2
Expand Down Expand Up @@ -422,7 +434,7 @@ with
##### Breaking
- The native iOS bridge uses [Braze iOS SDK 3.18.0](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#3180).
- The native Android bridge uses [Braze Android SDK 3.6.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#360).
- The native Android bridge uses [Braze Android SDK 3.6.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#360).
##### Added
- Added the following new field to `BrazeInAppMessage`: `zippedAssetsUrl`.
Expand All @@ -432,7 +444,7 @@ with
##### Breaking
- The native iOS bridge uses [Braze iOS SDK 3.15.0](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#3150).
- The native Android bridge uses [Braze Android SDK 3.5.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#350).
- The native Android bridge uses [Braze Android SDK 3.5.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#350).
- Support for the Android configuration parameter `com_appboy_inapp_show_inapp_messages_automatically` has been removed.
- To control whether an in-app message object should be displayed natively or not, create and register an instance of `IInAppMessageManagerListener` in your native Android code and implement decisioning in the `beforeInAppMessageDisplayed` method. See `MainActivity` in our sample app for an example.
- On Android, in-app message objects are no longer sent automatically to the Dart in-app message callback after calling `BrazePlugin.setBrazeInAppMessageCallback()` in your Dart code.
Expand All @@ -454,7 +466,7 @@ with
##### Breaking
- The native iOS bridge uses [Braze iOS SDK 3.14.0](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#3140).
- The native Android bridge uses [Braze Android SDK 3.2.1](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#321).
- The native Android bridge uses [Braze Android SDK 3.2.1](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#321).
##### Added
- Adds `addAlias()` to the public API interface.
Expand Down Expand Up @@ -484,4 +496,4 @@ with
## 0.0.1
- Initial release.
- The native iOS bridge uses [Braze iOS SDK 3.12.0](https://github.com/Appboy/appboy-ios-sdk/releases/tag/3.12.0).
- The native Android bridge uses [Braze Android SDK 3.1.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#310).
- The native Android bridge uses [Braze Android SDK 3.1.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#310).
6 changes: 6 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,10 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "com.braze:android-sdk-ui:30.3.0"

androidTestImplementation "org.mockito:mockito-android:3.12.4"
androidTestImplementation "junit:junit:4.13.2"
androidTestImplementation "org.mockito:mockito-core:3.12.4"
androidTestImplementation "org.mockito.kotlin:mockito-kotlin:3.2.0"
androidTestImplementation("androidx.test:runner:1.5.2")
}
138 changes: 138 additions & 0 deletions android/src/androidTest/kotlin/FlutterConfigurationTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import android.content.Context
import android.content.res.Resources
import com.braze.brazeplugin.FlutterConfiguration
import com.braze.ui.inappmessage.InAppMessageOperation
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.mock

class FlutterConfigurationTest {

@Test
fun whenBooleanValueExistsInResources_isAutomaticInitializationEnabled_returnsValue() {
val key = "com_braze_flutter_enable_automatic_integration_initializer"
val testResId = 1234
val value = false
val testPackageName = "foo.bar.braze"
val mockResources = mock<Resources>() {
on { getIdentifier(key, "bool", testPackageName) } doReturn 1234
on { getBoolean(testResId) } doReturn value
}

val context: Context = mock<Context>() {
on { resources } doReturn mockResources
on { packageName } doReturn testPackageName
}
val flutterConfiguration = FlutterConfiguration(context)
assertEquals(
value,
flutterConfiguration.isAutomaticInitializationEnabled()
)
}

@Test
fun whenBooleanValueDoesNotExistInResources_isAutomaticInitializationEnabled_returnsTrue() {
val key = "com_braze_flutter_enable_automatic_integration_initializer"
val testResId = 1234
val testPackageName = "foo.bar.braze"
val mockResources = mock<Resources>() {
on { getIdentifier(key, "bool", testPackageName) } doReturn 0
}

val context: Context = mock<Context>() {
on { resources } doReturn mockResources
on { packageName } doReturn testPackageName
}
val flutterConfiguration = FlutterConfiguration(context)
assertTrue(
flutterConfiguration.isAutomaticInitializationEnabled()
)
}

@Test
fun whenStringValueExistsInResources_automaticIntegrationInAppMessageOperation_returnsValue() {
val key = "com_braze_flutter_automatic_integration_iam_operation"
val testResId = 1234
val value = "DISCARD"
val testPackageName = "foo.bar.braze"
val mockResources = mock<Resources>() {
on { getIdentifier(key, "string", testPackageName) } doReturn 1234
on { getString(testResId) } doReturn value
}

val context: Context = mock<Context>() {
on { resources } doReturn mockResources
on { packageName } doReturn testPackageName
}
val flutterConfiguration = FlutterConfiguration(context)
assertEquals(
InAppMessageOperation.DISCARD,
flutterConfiguration.automaticIntegrationInAppMessageOperation()
)
}

@Test
fun whenStringValueDoesNotExistInResources_automaticIntegrationInAppMessageOperation_returnsDisplayNow() {
val key = "com_braze_flutter_automatic_integration_iam_operation"
val testPackageName = "foo.bar.braze"
val mockResources = mock<Resources>() {
on { getIdentifier(key, "string", testPackageName) } doReturn 1234
}

val context: Context = mock<Context>() {
on { resources } doReturn mockResources
on { packageName } doReturn testPackageName
}
val flutterConfiguration = FlutterConfiguration(context)
assertEquals(
InAppMessageOperation.DISPLAY_NOW,
flutterConfiguration.automaticIntegrationInAppMessageOperation()
)
}

@Test
fun whenStringValueIsGarbage_automaticIntegrationInAppMessageOperation_returnsDisplayNow() {
val key = "com_braze_flutter_automatic_integration_iam_operation"
val testResId = 1234
val value = "yeet_it"
val testPackageName = "foo.bar.braze"
val mockResources = mock<Resources>() {
on { getIdentifier(key, "string", testPackageName) } doReturn 1234
on { getString(testResId) } doReturn value
}

val context: Context = mock<Context>() {
on { resources } doReturn mockResources
on { packageName } doReturn testPackageName
}
val flutterConfiguration = FlutterConfiguration(context)
assertEquals(
InAppMessageOperation.DISPLAY_NOW,
flutterConfiguration.automaticIntegrationInAppMessageOperation()
)
}

@Test
fun whenStringValueIsMixedCaseInResources_automaticIntegrationInAppMessageOperation_returnsValue() {
val key = "com_braze_flutter_automatic_integration_iam_operation"
val testResId = 1234
val value = "DiSpLay_LaTeR"
val testPackageName = "foo.bar.braze"
val mockResources = mock<Resources>() {
on { getIdentifier(key, "string", testPackageName) } doReturn 1234
on { getString(testResId) } doReturn value
}

val context: Context = mock<Context>() {
on { resources } doReturn mockResources
on { packageName } doReturn testPackageName
}
val flutterConfiguration = FlutterConfiguration(context)
assertEquals(
InAppMessageOperation.DISPLAY_LATER,
flutterConfiguration.automaticIntegrationInAppMessageOperation()
)
}
}
Loading

0 comments on commit 01c6a83

Please sign in to comment.