Skip to content

Feature/add full deep link support to kotlin sample #133

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

Conversation

didiergarcia
Copy link
Contributor

@didiergarcia didiergarcia commented Feb 13, 2023

Add full support for deep links in Kotlin Analytics.

This adds a new top-level API trackDeepLinkOpen() function to the Analytics functions that people will use to manually track the app opening from a deep link.

@codecov-commenter
Copy link

Codecov Report

Base: 78.32% // Head: 78.32% // No change to project coverage 👍

Coverage data is based on head (244815d) compared to base (fc5d0a9).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #133   +/-   ##
=========================================
  Coverage     78.32%   78.32%           
  Complexity      477      477           
=========================================
  Files            71       71           
  Lines          5914     5914           
  Branches        736      736           
=========================================
  Hits           4632     4632           
  Misses          708      708           
  Partials        574      574           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

// if the Activity is created, but not if it is re-used. Therefore we have to add this
// code to manually capture the Deep Link info.

Analytics.addDeepLinkOpen(analytics, "deep-link", intent)
Copy link
Contributor

Choose a reason for hiding this comment

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

out of curiosity, why do we choose to add an extend function for Analytics.Companion instead for Analytics? if we extend Analytics, we can do something like

analytics.addDeepLinkOpen("deep-link", intent)

it seems cleaner 😄
also, would trackDeepLinkOpen be a better name? feels more consistent than the track calls

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great Questions!

Why add the function on Analytics (static) instead analytics:

So this was a conscious choice because in looking at code in MainActivityit had both types of calls:

Analytics.debugLogsEnabled = true

And

analytics.flush()

I decided to go with static function because I thought it made sense, but it's not a hard decision to change. I will update it!

Regarding the name of the function: I like your name better. Consider it changed.

Copy link
Contributor

@wenxi-zeng wenxi-zeng left a comment

Choose a reason for hiding this comment

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

LGTM

@didiergarcia didiergarcia merged commit 4a5d2be into main Feb 13, 2023
@didiergarcia didiergarcia deleted the feature/add-full-deep-link-support-to-kotlin-sample branch February 13, 2023 22:03
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