Skip to content

Conversation

@k-antipochkin
Copy link
Collaborator

@k-antipochkin k-antipochkin commented Sep 24, 2025

User description

Description of Changes

Use reflective status bar color painting on pre‑Android 15 (API <35) to avoid Play deprecation warnings

Breaking Changes

  • None

Release Checklist

Prepare:

-[ ] Detail any breaking changes. Breaking changes require a new major version number, and a migration guide in wiki / README.md

Bump versions in:

  • CHANGELOG.md
  • gradle.properties
    -[ ] add links to newly created wiki pages to readme
    -[ ] Update major version numbers in wiki (basic integration + push guides)

Integration tests

T&T Only

  • Init SDK with only optimove credentials
  • Associate customer
  • Associate email
  • Track events

Mobile Only

  • Init SDK with all credentials
  • Track events
  • Associate customer (verify both backends)
  • Register for push
  • Opt-in for In-App
  • Send test push
  • Send test In-App
  • Receive / trigger deep link handler (In-App/Push)
  • Receive / trigger the content extension, render image and action buttons for push
  • Verify push opened handler

Deferred Deep Links

  • With app installed, trigger deep link handler
  • With app uninstalled, follow deep link, install test bundle, verify deep link read from Clipboard, trigger deep link handler

Combined

  • Track event for T&T, verify push received
  • Trigger scheduled campaign, verify push received
  • Trigger scheduled campaign, verify In-App received

Release Procedure

  • Squash and merge dev to master
  • Delete branch once merged

Generated description

Below is a concise technical summary of the changes proposed in this PR:

graph LR
setStatusBarColorForDialog_("setStatusBarColorForDialog"):::modified
getStatusBarColorLegacy_("getStatusBarColorLegacy"):::added
setStatusBarColorLegacy_("setStatusBarColorLegacy"):::added
unsetStatusBarColorForDialog_("unsetStatusBarColorForDialog"):::modified
closeDialog_("closeDialog"):::modified
onPageFinished_("onPageFinished"):::modified
showWebView_("showWebView"):::modified
WebView_("WebView"):::added
setStatusBarColorForDialog_ -- "Uses reflection to get status bar color on legacy Android." --> getStatusBarColorLegacy_
setStatusBarColorForDialog_ -- "Sets status bar color via reflection for legacy Android." --> setStatusBarColorLegacy_
unsetStatusBarColorForDialog_ -- "Restores previous status bar color on legacy Android devices." --> setStatusBarColorLegacy_
closeDialog_ -- "Resets status bar color on dialog close for legacy Android." --> unsetStatusBarColorForDialog_
onPageFinished_ -- "Updates status bar color after page load on legacy Android." --> setStatusBarColorForDialog_
showWebView_ -- "Enables WebView debugging unconditionally in debug builds." --> WebView_
classDef added stroke:#15AA7A
classDef removed stroke:#CD5270
classDef modified stroke:#EDAC4C
linkStyle default stroke:#CBD5E1,font-size:13px
Loading

Implement reflective access to Window.setStatusBarColor() and Window.getStatusBarColor() within the InAppMessageView component for Android versions below API 35, addressing Play Store deprecation warnings related to status bar color painting. Update the SDK version and changelog to reflect these changes.

TopicDetails
Reflective Status Bar Implement reflective access to Window.setStatusBarColor() and Window.getStatusBarColor() for Android versions below API 35 to manage status bar colors for in-app messages, avoiding Play Store deprecation warnings.
Modified files (1)
  • OptimoveSDK/optimove-sdk/src/main/java/com/optimove/android/optimobile/InAppMessageView.java
Latest Contributors(2)
UserCommitDate
tom_b@optimove.comdeleted-redundant-call...November 21, 2022
konstantin_a@optimove.comChanged-the-API-of-pus...October 13, 2022
Version Updates Update the SDK version to 7.7.1 and version code to 70701 in gradle.properties, and add a corresponding entry to CHANGELOG.md.
Modified files (2)
  • OptimoveSDK/gradle.properties
  • CHANGELOG.md
Latest Contributors(2)
UserCommitDate
adamball1update-sdk_version_cod...August 05, 2025
vvoicehovicsAB-251460-API-to-set-n...June 20, 2025
This pull request is reviewed by Baz. Review like a pro on (Baz).

wv.evaluateJavascript(script, null);
} else {
wv.loadUrl("javascript:" + script);
wv.evaluateJavascript(script, null);
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing the API level check for evaluateJavascript could cause crashes on devices below API 19. Should we keep the fallback to loadUrl?

Suggested change
wv.evaluateJavascript(script, null);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
wv.evaluateJavascript(script, null);
} else {
wv.loadUrl("javascript:" + script);
}

Finding type: Logical Bugs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The SDK's minimal API is 21

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it! I'll remember that the SDK's minimal API is 21 after the PR is merged.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
settings.setMediaPlaybackRequiresUserGesture(false);
}
settings.setMediaPlaybackRequiresUserGesture(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing the API level check for setMediaPlaybackRequiresUserGesture could cause crashes on devices below API 17. Consider adding the version check back?

Suggested change
settings.setMediaPlaybackRequiresUserGesture(false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
settings.setMediaPlaybackRequiresUserGesture(false);
}

Finding type: Logical Bugs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The SDK's minimal API is 21

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it! I'll remember that the SDK's minimal API is 21 after the PR is merged.

Co-authored-by: baz-reviewer[bot] <174234987+baz-reviewer[bot]@users.noreply.github.com>
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.

2 participants