Skip to content
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

feat: add option to disable screen view usage #474

Merged
merged 6 commits into from
Dec 17, 2024

Conversation

mrehan27
Copy link
Contributor

part of: MBL-755

Changes

  • Added screenViewUse enum option to allow disable sending screen view events to server and use them locally only
  • Added ScreenFilterPlugin to filter events based on the screenViewUse configuration
  • Added tests to ensure functionality

ScreenView Options

  • Analytics -> Sends all screen events to the server (same as before) - Default behavior
  • InApp -> Retains screen events locally for in-app use only

Sample Usage

CustomerIOBuilder(...)
    .screenViewUse(ScreenView.InApp)
    .build()

@mrehan27 mrehan27 requested a review from Shahroz16 December 13, 2024 20:14
@mrehan27 mrehan27 self-assigned this Dec 13, 2024
Copy link

github-actions bot commented Dec 13, 2024

Sample app builds 📱

Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.


Copy link

Build available to test
Version: rehan-mbl-755-screen-config-sdk-SNAPSHOT
Repository: https://s01.oss.sonatype.org/content/repositories/snapshots/

Copy link

  • java_layout: rehan/mbl-755-screen-config-sdk (1734120908)

Copy link

github-actions bot commented Dec 13, 2024

📏 SDK Binary Size Comparison Report

No changes detected in SDK binary size ✅

Copy link

  • kotlin_compose: rehan/mbl-755-screen-config-sdk (1734120918)

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.

Project coverage is 52.28%. Comparing base (8b30804) to head (0a6fdb3).
Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
...stomer/datapipelines/plugins/ScreenFilterPlugin.kt 83.33% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##               main     #474       +/-   ##
=============================================
+ Coverage     41.98%   52.28%   +10.29%     
- Complexity      259      302       +43     
=============================================
  Files            99       98        -1     
  Lines          2320     2607      +287     
  Branches        344      360       +16     
=============================================
+ Hits            974     1363      +389     
+ Misses         1247     1135      -112     
- Partials         99      109       +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

  • java_layout: rehan/mbl-755-screen-config-sdk (1734343917)

Copy link

  • kotlin_compose: rehan/mbl-755-screen-config-sdk (1734343926)

Copy link

  • java_layout: rehan/mbl-755-screen-config-sdk (1734348058)

Copy link

  • kotlin_compose: rehan/mbl-755-screen-config-sdk (1734348049)

Copy link
Contributor

@mahmoud-elmorabea mahmoud-elmorabea left a comment

Choose a reason for hiding this comment

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

I think we should minimize public API changes and limit it to work around the issue we have at the moment and leave larger API changes to a later point where we re-think having parts of our SDK enabled using a comprehensive mechanism.

/**
* Enum class to define how CustomerIO SDK should handle screen view events.
*/
enum class ScreenView {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean it's a mutually exclusive choice? I can either choose analytics or in-app? But what if a customer needs both?

/**
* Enum class to define how CustomerIO SDK should handle screen view events.
*/
enum class ScreenView {
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious why we are opting for making this an enum instead of:

  • Boolean to allow screen analytics
  • If in app is enabled, we always use screen views for in-app

Copy link

  • java_layout: rehan/mbl-755-screen-config-sdk (1734426234)

Copy link

  • kotlin_compose: rehan/mbl-755-screen-config-sdk (1734426230)

Copy link

  • java_layout: rehan/mbl-755-screen-config-sdk (1734465106)

Copy link

  • kotlin_compose: rehan/mbl-755-screen-config-sdk (1734465108)

Copy link

  • java_layout: rehan/mbl-755-screen-config-sdk (1734465376)

Copy link

  • kotlin_compose: rehan/mbl-755-screen-config-sdk (1734465377)

@Shahroz16 Shahroz16 merged commit b5ea8e9 into main Dec 17, 2024
33 of 35 checks passed
@Shahroz16 Shahroz16 deleted the rehan/mbl-755-screen-config-sdk branch December 17, 2024 20:12
github-actions bot pushed a commit that referenced this pull request Dec 17, 2024
## [4.5.0](4.4.1...4.5.0) (2024-12-17)

### Features

* add option to disable screen view usage ([#474](#474)) ([b5ea8e9](b5ea8e9))
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