Skip to content

Conversation

@simonbullen
Copy link

@simonbullen simonbullen commented Jun 27, 2025

This PR adds CTInAppHtmlBannerOverlay to handle custom-html header and footer CTInAppNotification banners when the current activity is not a FragmentActivity.

This allows CTInAppTypeFooterHTML and CTInAppTypeHeaderHTML notifications to work on Unreal, which can't easily provide a FragmentActivity.

Summary by CodeRabbit

  • New Features

    • Introduced a new in-app notification system with enhanced support for various notification types, including HTML, native, and custom templates.
    • Added new UI components for in-app notifications, including banners, headers, footers, interstitials, and media-rich notifications.
    • Improved support for push notification permission prompts and system event management.
    • Enhanced encryption for network communication and content fetch requests.
  • Bug Fixes

    • Improved error handling and resource cleanup for in-app notifications and media assets.
  • Refactor

    • Migrated in-app notification logic and UI components to Kotlin for better maintainability and modularity.
    • Simplified and unified the handling of notification actions, layouts, and media.
    • Streamlined network, storage, and event management for improved performance and reliability.
  • Chores

    • Updated and consolidated test coverage exclusions for in-app notification components.
    • Improved internal state and dependency management throughout the SDK.
  • Documentation

    • Updated documentation to reflect new and refactored in-app notification APIs and behaviors.

@francispereira
Copy link

francispereira commented Jun 27, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

@simonbullen simonbullen marked this pull request as ready for review June 27, 2025 05:33
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 27, 2025

Caution

Review failed

Failed to post review comments.

Walkthrough

This change completely rewrites the in-app notification system, removing all legacy Java-based in-app notification classes and fragments and replacing them with a new Kotlin-based architecture. The new implementation introduces redesigned models, controllers, fragments, overlays, and supporting infrastructure for queuing, inflating, displaying, and handling user interactions with in-app notifications.

Changes

Files / Groups Change Summary
clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInApp*, InAppController.java, fragment/CTInApp*, InAppWebViewClient.kt All legacy Java in-app notification classes, fragments, and webview clients removed.
clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInApp*, InAppController.kt, fragment/CTInApp*, InAppWebViewClient.kt, PartialHtmlInAppGestureListener.kt, StoreRegistryInAppQueue.kt, InAppNotificationInflater.kt New Kotlin-based in-app notification models, controller, fragments, overlays, queue, gesture listener, and inflater added.
clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppNotification.kt, CTInAppNotificationButton.kt, CTInAppNotificationMedia.kt, CTInAppType.kt, CTInAppAction.kt, InAppQueue.kt In-app notification model, button, media, type enum, action, and queue interface rewritten in Kotlin.
clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppHost.kt New host class for in-app notification event delegation and listener management.
clevertap-core/src/main/java/com/clevertap/android/sdk/ActivityLifeCycleManager.java Method updated to use new in-app controller API.
.run/All Tests.run.xml Test exclusion patterns updated for new/removed in-app classes.
clevertap-core/src/main/java/com/clevertap/android/sdk/CTWebInterface.java Refactored to use new in-app host abstraction.
clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/customtemplates/CustomTemplateContext.kt, CustomTemplateInAppData.kt Visibility modifiers and JSON copying updated for new model structure.
clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/data/InAppResponseAdapter.kt Media instantiation updated for new Kotlin model.
Other supporting files (CTXtensions.kt, etc.) Utility and extension functions added or updated for new models.

Sequence Diagram(s)

sequenceDiagram
    participant App as Application/Activity
    participant InAppController
    participant InAppQueue
    participant InAppNotificationInflater
    participant Fragment/Overlay
    participant InAppHost
    participant Listener

    App->>InAppController: onAppLaunch / onEvent / onProfileChange
    InAppController->>InAppQueue: Enqueue eligible in-app notifications
    App->>InAppController: showNotificationIfAvailable()
    InAppController->>InAppQueue: Dequeue next notification
    InAppController->>InAppNotificationInflater: Inflate notification (async)
    InAppNotificationInflater-->>InAppController: Notification ready
    InAppController->>Fragment/Overlay: Show notification UI
    Fragment/Overlay->>InAppHost: User interacts (click, dismiss, etc.)
    InAppHost->>Listener: Notify action/click/dismiss
    InAppHost->>InAppController: Trigger next notification if needed
Loading

Possibly related PRs

  • #790: Refactored CTWebInterface and webview cleanup; related as both PRs overhaul in-app webview handling and lifecycle.
  • #831: Kotlin conversion of in-app package, including InAppController; directly connected as both represent the same migration.
  • #785: Introduces system in-app functions and InAppActionHandler, which the new InAppController depends on for action handling.

Suggested labels

eaa

Suggested reviewers

  • darshanclevertap
  • piyush-kukadiya
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppHtmlBannerOverlay.java (1)

161-169: Consider configuration changes and verify window type compatibility

The overlay doesn't handle configuration changes (e.g., device rotation) which could cause display issues. Also, TYPE_APPLICATION_PANEL behavior should be verified across Android versions.

Consider implementing configuration change handling or documenting that the overlay should be dismissed on configuration changes. Also, please verify that TYPE_APPLICATION_PANEL works correctly on your target Android versions:

What are the restrictions and best practices for using WindowManager.LayoutParams.TYPE_APPLICATION_PANEL in Android 12 and above?
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80038e8 and 2f8ba04.

📒 Files selected for processing (2)
  • clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppHtmlBannerOverlay.java (1 hunks)
  • clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/InAppController.java (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#802
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppNotification.java:180-182
Timestamp: 2025-05-08T08:31:50.340Z
Learning: The CTInAppNotification class in the CleverTap Android SDK adds new fields `aspectRatio` and `isRequestForPushPermission` to its Parcel implementation in version 7.4.0, but doesn't require parcel versioning as these parcels only exist in memory during a single app session.
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#802
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppWebView.kt:60-78
Timestamp: 2025-05-08T08:32:26.358Z
Learning: The CleverTap Android SDK has backend validation checks that ensure zero/negative dimensions don't occur when instantiating CTInAppWebView, making additional guard clauses unnecessary at this level.
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#797
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppNotification.java:184-185
Timestamp: 2025-04-28T08:41:36.134Z
Learning: In the CleverTap Android SDK, parcels in the CTInAppNotification class exist only in memory and are not persisted, so backward compatibility concerns between different SDK versions are not applicable for these parcels.
Learnt from: Anush-Shand
PR: CleverTap/clevertap-android-sdk#734
File: clevertap-pushtemplates/src/main/res/layout-v31/timer.xml:58-60
Timestamp: 2025-05-28T11:10:51.166Z
Learning: For API 31+ (Android 12+) in CleverTap push templates, action buttons are handled through official Android notification APIs rather than custom layout includes. The API 31+ layout versions intentionally omit @layout/action_buttons inclusions because the action buttons are managed by the Android system's notification builder APIs directly.
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#741
File: clevertap-core/src/main/java/com/clevertap/android/sdk/AnalyticsManager.java:1143-1143
Timestamp: 2025-01-24T11:56:39.526Z
Learning: Privacy and security related changes in the CleverTap Android SDK, such as PII exposure in logs, should be discussed with the team before implementation to ensure proper handling of sensitive data.
Learnt from: vasct
PR: CleverTap/clevertap-android-sdk#831
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/fragment/CTInAppNativeCoverImageFragment.kt:55-59
Timestamp: 2025-06-18T09:47:50.616Z
Learning: In CleverTap Android SDK in-app notification fragments, the `isHideCloseButton` flag has counterintuitive logic where `!isHideCloseButton` sets visibility to GONE and `isHideCloseButton` sets visibility to VISIBLE. This is intentional behavior preserved from the original Java implementation and should not be "fixed" during Kotlin conversion.
Learnt from: vasct
PR: CleverTap/clevertap-android-sdk#831
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/fragment/CTInAppBasePartialHtmlFragment.kt:118-120
Timestamp: 2025-06-18T09:52:22.861Z
Learning: The onTouch method in CTInAppBasePartialHtmlFragment intentionally returns `gd.onTouchEvent(event) || (event.action == MotionEvent.ACTION_MOVE)` to maintain existing Java behavior during Kotlin conversion, even though this might consume MOVE events that could affect WebView scrolling.
Learnt from: vasct
PR: CleverTap/clevertap-android-sdk#831
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/fragment/CTInAppBaseFullHtmlFragment.kt:71-79
Timestamp: 2025-06-18T12:06:46.032Z
Learning: The CTInAppWebView constructor sets the view ID internally, so there's no need to explicitly call View.generateViewId() when creating CTInAppWebView instances. The ID is available for use in layout rules like RIGHT_OF and ABOVE.
Learnt from: Anush-Shand
PR: CleverTap/clevertap-android-sdk#802
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/InAppController.java:751-759
Timestamp: 2025-05-08T08:30:59.935Z
Learning: The `showInApp()` method in InAppController is always called from the main thread, even when triggered via task callbacks.
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#802
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppBaseFullHtmlFragment.java:44-48
Timestamp: 2025-05-08T08:25:14.692Z
Learning: In the CleverTap Android SDK, fragments are managed using add and remove methods rather than replace, so resources are properly cleaned up in onDestroyView() without needing additional cleanup in onDestroy().
clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/InAppController.java (9)
Learnt from: Anush-Shand
PR: CleverTap/clevertap-android-sdk#802
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/InAppController.java:751-759
Timestamp: 2025-05-08T08:30:59.935Z
Learning: The `showInApp()` method in InAppController is always called from the main thread, even when triggered via task callbacks.
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#797
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppNotification.java:184-185
Timestamp: 2025-04-28T08:41:36.134Z
Learning: In the CleverTap Android SDK, parcels in the CTInAppNotification class exist only in memory and are not persisted, so backward compatibility concerns between different SDK versions are not applicable for these parcels.
Learnt from: vasct
PR: CleverTap/clevertap-android-sdk#831
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/fragment/CTInAppNativeCoverImageFragment.kt:55-59
Timestamp: 2025-06-18T09:47:50.616Z
Learning: In CleverTap Android SDK in-app notification fragments, the `isHideCloseButton` flag has counterintuitive logic where `!isHideCloseButton` sets visibility to GONE and `isHideCloseButton` sets visibility to VISIBLE. This is intentional behavior preserved from the original Java implementation and should not be "fixed" during Kotlin conversion.
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#802
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppNotification.java:180-182
Timestamp: 2025-05-08T08:31:50.340Z
Learning: The CTInAppNotification class in the CleverTap Android SDK adds new fields `aspectRatio` and `isRequestForPushPermission` to its Parcel implementation in version 7.4.0, but doesn't require parcel versioning as these parcels only exist in memory during a single app session.
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#802
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppWebView.kt:60-78
Timestamp: 2025-05-08T08:32:26.358Z
Learning: The CleverTap Android SDK has backend validation checks that ensure zero/negative dimensions don't occur when instantiating CTInAppWebView, making additional guard clauses unnecessary at this level.
Learnt from: vasct
PR: CleverTap/clevertap-android-sdk#831
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/InAppController.kt:435-448
Timestamp: 2025-06-18T09:50:46.757Z
Learning: During Java to Kotlin conversions in the CleverTap Android SDK, vasct maintains the exact same logic for activity blacklist checks using `activity.getLocalClassName()`, even if there are potential improvements, to keep functional changes separate from conversion changes.
Learnt from: Anush-Shand
PR: CleverTap/clevertap-android-sdk#734
File: clevertap-pushtemplates/src/main/res/layout-v31/timer.xml:58-60
Timestamp: 2025-05-28T11:10:51.166Z
Learning: For API 31+ (Android 12+) in CleverTap push templates, action buttons are handled through official Android notification APIs rather than custom layout includes. The API 31+ layout versions intentionally omit @layout/action_buttons inclusions because the action buttons are managed by the Android system's notification builder APIs directly.
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#802
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppBaseFullHtmlFragment.java:44-48
Timestamp: 2025-05-08T08:25:14.692Z
Learning: In the CleverTap Android SDK, fragments are managed using add and remove methods rather than replace, so resources are properly cleaned up in onDestroyView() without needing additional cleanup in onDestroy().
Learnt from: vasct
PR: CleverTap/clevertap-android-sdk#831
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/fragment/CTInAppBasePartialHtmlFragment.kt:118-120
Timestamp: 2025-06-18T09:52:22.861Z
Learning: The onTouch method in CTInAppBasePartialHtmlFragment intentionally returns `gd.onTouchEvent(event) || (event.action == MotionEvent.ACTION_MOVE)` to maintain existing Java behavior during Kotlin conversion, even though this might consume MOVE events that could affect WebView scrolling.
clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppHtmlBannerOverlay.java (11)
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#797
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppNotification.java:184-185
Timestamp: 2025-04-28T08:41:36.134Z
Learning: In the CleverTap Android SDK, parcels in the CTInAppNotification class exist only in memory and are not persisted, so backward compatibility concerns between different SDK versions are not applicable for these parcels.
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#802
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppNotification.java:180-182
Timestamp: 2025-05-08T08:31:50.340Z
Learning: The CTInAppNotification class in the CleverTap Android SDK adds new fields `aspectRatio` and `isRequestForPushPermission` to its Parcel implementation in version 7.4.0, but doesn't require parcel versioning as these parcels only exist in memory during a single app session.
Learnt from: Anush-Shand
PR: CleverTap/clevertap-android-sdk#734
File: clevertap-pushtemplates/src/main/res/layout-v31/timer.xml:58-60
Timestamp: 2025-05-28T11:10:51.166Z
Learning: For API 31+ (Android 12+) in CleverTap push templates, action buttons are handled through official Android notification APIs rather than custom layout includes. The API 31+ layout versions intentionally omit @layout/action_buttons inclusions because the action buttons are managed by the Android system's notification builder APIs directly.
Learnt from: vasct
PR: CleverTap/clevertap-android-sdk#831
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/fragment/CTInAppNativeCoverImageFragment.kt:55-59
Timestamp: 2025-06-18T09:47:50.616Z
Learning: In CleverTap Android SDK in-app notification fragments, the `isHideCloseButton` flag has counterintuitive logic where `!isHideCloseButton` sets visibility to GONE and `isHideCloseButton` sets visibility to VISIBLE. This is intentional behavior preserved from the original Java implementation and should not be "fixed" during Kotlin conversion.
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#802
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppWebView.kt:60-78
Timestamp: 2025-05-08T08:32:26.358Z
Learning: The CleverTap Android SDK has backend validation checks that ensure zero/negative dimensions don't occur when instantiating CTInAppWebView, making additional guard clauses unnecessary at this level.
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#802
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppBaseFullHtmlFragment.java:44-48
Timestamp: 2025-05-08T08:25:14.692Z
Learning: In the CleverTap Android SDK, fragments are managed using add and remove methods rather than replace, so resources are properly cleaned up in onDestroyView() without needing additional cleanup in onDestroy().
Learnt from: vasct
PR: CleverTap/clevertap-android-sdk#831
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/InAppController.kt:435-448
Timestamp: 2025-06-18T09:50:46.757Z
Learning: During Java to Kotlin conversions in the CleverTap Android SDK, vasct maintains the exact same logic for activity blacklist checks using `activity.getLocalClassName()`, even if there are potential improvements, to keep functional changes separate from conversion changes.
Learnt from: vasct
PR: CleverTap/clevertap-android-sdk#831
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/fragment/CTInAppBasePartialHtmlFragment.kt:118-120
Timestamp: 2025-06-18T09:52:22.861Z
Learning: The onTouch method in CTInAppBasePartialHtmlFragment intentionally returns `gd.onTouchEvent(event) || (event.action == MotionEvent.ACTION_MOVE)` to maintain existing Java behavior during Kotlin conversion, even though this might consume MOVE events that could affect WebView scrolling.
Learnt from: CTLalit
PR: CleverTap/clevertap-android-sdk#741
File: clevertap-core/src/main/java/com/clevertap/android/sdk/AnalyticsManager.java:1143-1143
Timestamp: 2025-01-24T11:56:39.526Z
Learning: Privacy and security related changes in the CleverTap Android SDK, such as PII exposure in logs, should be discussed with the team before implementation to ensure proper handling of sensitive data.
Learnt from: vasct
PR: CleverTap/clevertap-android-sdk#831
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/fragment/CTInAppBaseFullHtmlFragment.kt:71-79
Timestamp: 2025-06-18T12:06:46.032Z
Learning: The CTInAppWebView constructor sets the view ID internally, so there's no need to explicitly call View.generateViewId() when creating CTInAppWebView instances. The ID is available for use in layout rules like RIGHT_OF and ABOVE.
Learnt from: vasct
PR: CleverTap/clevertap-android-sdk#785
File: clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/customtemplates/system/PushPermissionTemplate.kt:17-27
Timestamp: 2025-03-31T13:24:07.074Z
Learning: In template presenters for the CleverTap Android SDK, it's sometimes intentional to call both `setPresented()` and `setDismissed()` on the same template context. Specifically in PushPermissionTemplate, the presenter should always call `setDismissed()`, and additionally call `setPresented()` when the permission prompt is successfully launched.
🔇 Additional comments (4)
clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/InAppController.java (1)

797-811: Well-designed fallback mechanism for non-FragmentActivity contexts

The integration of the overlay-based display as a fallback is clean and maintains backward compatibility. This successfully enables HTML banner notifications in environments like Unreal that use NativeActivity instead of FragmentActivity.

clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppHtmlBannerOverlay.java (3)

49-84: Clean API design for overlay-based banner display

The class provides a minimal, well-documented API that clearly explains its purpose as a fragment-free alternative for HTML banners. The defensive handling in display() when canDisplay() returns false ensures proper cleanup.


221-231: Proper WebView cleanup implementation

The WebView cleanup is thorough and includes proper error handling. The null checks and exception handling ensure safe cleanup even in edge cases.


1-454: Ensure comprehensive testing of the overlay approach

Since this introduces a new display mechanism for in-app notifications, please ensure thorough testing across:

  • Different Android versions (especially Android 12+)
  • App lifecycle events (backgrounding, foregrounding)
  • Configuration changes (rotation, theme changes)
  • Multiple overlay scenarios
  • Memory leak detection using LeakCanary

simonbullen and others added 3 commits July 9, 2025 14:47
Convert CTInAppHtmlBannerOverlay to Kotlin
Extract common logic from CTInAppBaseFragment in CTInAppHost and remove the
fragment dependencies from CTInAppWebView and CTWebInterface
Move InAppWebViewClient inside CTInAppWebView
@vasct vasct force-pushed the HtmlBannerOverlays branch from 1ae0803 to 0bca2ef Compare July 9, 2025 13:17
@vasct vasct changed the base branch from master to release/SDK-5014/core_7.5.0 July 9, 2025 13:17
Base automatically changed from release/SDK-5014/core_7.5.0 to develop July 11, 2025 16:28
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