customerio / customerio-android

This is the official Customer.io SDK for Android.
MIT License
11 stars 9 forks source link

feat: expose public APIs to identify and clear profiles #322

Closed mrehan27 closed 1 month ago

mrehan27 commented 2 months ago

part of MBL-214

Changes

Example Usage

Kotlin

CustomerIO.instance().identify(userId = email)
CustomerIO.instance().identify(userId = email, traits = mapOf("name" to name))
CustomerIO.instance().profileAttributes = mapOf("age" to age)
CustomerIO.instance().clearIdentify()

Java

CustomerIO.instance().identify(email)
CustomerIO.instance().identify(email, attributes)
CustomerIO.instance().setProfileAttributes(attributes)
CustomerIO.instance().clearIdentify()

Not Included

Tests are not included in this PR as we need to develop the base test structure. However, tests will be added in upcoming PRs soon.

github-actions[bot] commented 2 months ago
# 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. --- * java_layout: `rehan/mbl-214-identify-profile (1715240324)` * kotlin_compose: `rehan/mbl-214-identify-profile (1715240326)`
codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 53.73%. Comparing base (48c64c9) to head (ea15d79). Report is 19 commits behind head on feature/cdp.

:exclamation: Current head ea15d79 differs from pull request most recent head 9cb7460. Consider uploading reports for the commit 9cb7460 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## feature/cdp #322 +/- ## ================================================= - Coverage 54.45% 53.73% -0.73% + Complexity 282 276 -6 ================================================= Files 109 105 -4 Lines 2534 2466 -68 Branches 355 345 -10 ================================================= - Hits 1380 1325 -55 + Misses 1032 1024 -8 + Partials 122 117 -5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 2 months ago

📏 SDK Binary Size Comparison Report

No changes detected in SDK binary size ✅

github-actions[bot] commented 2 months ago

Build available to test Version: rehan-mbl-214-identify-profile-SNAPSHOT Repository: https://s01.oss.sonatype.org/content/repositories/snapshots/

Shahroz16 commented 2 months ago

As discussed on the call, here are the PR suggestion ideas in a separate branch.

mrehan27 commented 2 months ago

@Shahroz16 Updated as discussed, changes are slightly bigger due to code movement in different files.