Skip to content

MOBILE-284: support shouldIncludeVersionCode parameter for init#207

Open
sergeysozinov wants to merge 2 commits into
developfrom
feature/MOBILE-284
Open

MOBILE-284: support shouldIncludeVersionCode parameter for init#207
sergeysozinov wants to merge 2 commits into
developfrom
feature/MOBILE-284

Conversation

@sergeysozinov

Copy link
Copy Markdown
Collaborator

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for a new shouldIncludeVersionCode initialization parameter in the Mindbox Flutter SDK configuration, ensuring it is sent over the method channel and applied on Android while remaining safely ignored on iOS.

Changes:

  • Added shouldIncludeVersionCode (default true) to Configuration and included it in Configuration.toMap().
  • Updated the Android plugin to read shouldIncludeVersionCode from init arguments (defaulting to true) and pass it into the native configuration builder.
  • Added/extended unit tests to verify the default behavior and method-channel forwarding.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
mindbox_platform_interface/test/src/types/mindbox_method_handler_test.dart Adds tests to verify init() forwards shouldIncludeVersionCode and that the default is true.
mindbox_platform_interface/test/src/types/configuration_test.dart Adds tests for Configuration.shouldIncludeVersionCode defaulting and toMap() output.
mindbox_platform_interface/lib/src/types/configuration.dart Introduces the new configuration field with documentation and ensures it’s serialized into the init argument map.
mindbox_android/android/src/main/kotlin/cloud/mindbox/mindbox_android/MindboxAndroidPlugin.kt Reads shouldIncludeVersionCode from Flutter args (with safe default) and applies it to the Android SDK config builder.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

val subscribeIfCreated: Boolean = args["subscribeCustomerIfCreated"] as Boolean
val shouldCreateCustomer: Boolean = args["shouldCreateCustomer"] as Boolean
val operationsDomainArg: String = args["operationsDomain"] as? String ?: ""
val shouldIncludeVersionCode: Boolean = args["shouldIncludeVersionCode"] as? Boolean ?: true

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А можно не передавать default?
В нативе выставился, то что нужно.
Чтобы при смене не пришлось тут делать изменения.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переделал

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants