-
Notifications
You must be signed in to change notification settings - Fork 7
IAF | Persisting the webview after close #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
evan-masseau
commented
May 23, 2025
evan-masseau
commented
May 23, 2025
sdk/analytics/src/main/java/com/klaviyo/analytics/networking/KlaviyoApiClient.kt
Show resolved
Hide resolved
evan-masseau
commented
May 23, 2025
sdk/core/src/main/java/com/klaviyo/core/utils/KlaviyoThreadHelper.kt
Outdated
Show resolved
Hide resolved
evan-masseau
commented
May 24, 2025
evan-masseau
commented
May 24, 2025
9 tasks
dan-peluso
reviewed
May 28, 2025
dan-peluso
reviewed
May 28, 2025
sdk/analytics/src/main/java/com/klaviyo/analytics/networking/KlaviyoApiClient.kt
Show resolved
Hide resolved
dan-peluso
reviewed
May 28, 2025
sdk/core/src/main/java/com/klaviyo/core/utils/KlaviyoThreadHelper.kt
Outdated
Show resolved
Hide resolved
dan-peluso
reviewed
May 28, 2025
dan-peluso
reviewed
May 28, 2025
dan-peluso
reviewed
May 28, 2025
sdk/forms/src/main/java/com/klaviyo/forms/bridge/JsBridgeObserverCollection.kt
Show resolved
Hide resolved
dan-peluso
approved these changes
May 28, 2025
…rm after device rotation.
a001b43
to
ea1de3f
Compare
9 tasks
evan-masseau
added a commit
that referenced
this pull request
May 30, 2025
…rvers (#265) * Added a bridge message so that webview knows when the local JS asset is present * Added a little observer framework for webview to start/stop observers when webview is able to receive * IAF | Lifecycle observers to support foreground/backgrounding tracking (#267) * Implements lifecycle observers to support foreground/backgrounding. Added a foregrounding event to lifecycle monitor * IAF | Profile observers (#266) * Adjusted several class/interface names in the bridge subpackage (#268) * State management/observer improvements (#271) * Fixes to state observers: - We can't re-instantiate State every time initialize is called: now that another module relies on State observers, we must be able to keep those observers in memory. Luckily, there's no ill effect of treating State as a singleton (in fact, we used to have it as an Object instead of Class) - We need state observers to be able to start/stop in reaction to a state change, so our prior concurrency solution is insufficient because that will encounter a concurrent mutation error. CopyOnWrite is the easy solution (converting to Rx is the better long term, but more complex?) * Convert the callback type for state observers from a two-arg key/value thing, which was confusing, to a strongly typed data class, left the old one in so this isn't a breaking change, even if it is just core * IAF | Persisting the webview after close (#270) * Move thread util to core package so it can be shared * Keep the webview in memory when detaching (i.e. after closing) * Add company ID observer to re-initialize the webview when company changes * Add unregister and reinitialize forms API methods
9 tasks
evan-masseau
added a commit
that referenced
this pull request
May 30, 2025
…rvers (#265) * Added a bridge message so that webview knows when the local JS asset is present * Added a little observer framework for webview to start/stop observers when webview is able to receive * IAF | Lifecycle observers to support foreground/backgrounding tracking (#267) * Implements lifecycle observers to support foreground/backgrounding. Added a foregrounding event to lifecycle monitor * IAF | Profile observers (#266) * Adjusted several class/interface names in the bridge subpackage (#268) * State management/observer improvements (#271) * Fixes to state observers: - We can't re-instantiate State every time initialize is called: now that another module relies on State observers, we must be able to keep those observers in memory. Luckily, there's no ill effect of treating State as a singleton (in fact, we used to have it as an Object instead of Class) - We need state observers to be able to start/stop in reaction to a state change, so our prior concurrency solution is insufficient because that will encounter a concurrent mutation error. CopyOnWrite is the easy solution (converting to Rx is the better long term, but more complex?) * Convert the callback type for state observers from a two-arg key/value thing, which was confusing, to a strongly typed data class, left the old one in so this isn't a breaking change, even if it is just core * IAF | Persisting the webview after close (#270) * Move thread util to core package so it can be shared * Keep the webview in memory when detaching (i.e. after closing) * Add company ID observer to re-initialize the webview when company changes * Add unregister and reinitialize forms API methods
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Finally updates the WebView to stay in memory after closing, and adds proper hooks to reinitialize on company ID change and lifecycle timeout.
Due Diligence
Release/Versioning Considerations
Patch
Contains internal changes or backwards-compatible bug fixes.Minor
Contains changes to the public API.Major
Contains breaking changes.Changelog / Code Overview
Primary stuff:
unregister
API method, and an internalreinitialize
for resetting the webviewSecondary stuff supporting the above
runOnUiThread
method to replace dependence on the nullablecurrentActivity
Test Plan
TODO - will compile in #265 so we can test against the fully merged branch
Related Issues/Tickets
Partially blocked by a bug that is fixed in #271
CHNL-19953