Skip to content

Commit

Permalink
feat: add default null values and @JvmOverloads to tracking methods
Browse files Browse the repository at this point in the history
To improve API usage for both Kotlin and Java SDK consumers
  • Loading branch information
wzieba committed Dec 13, 2023
1 parent 857127a commit cad7ca2
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ open class ParselyTracker protected constructor(siteId: String, flushInterval: I
*/
fun trackPageview(
url: String,
urlRef: String?,
urlMetadata: ParselyMetadata?,
extraData: Map<String?, Any?>?
urlRef: String? = null,
urlMetadata: ParselyMetadata? = null,
extraData: Map<String?, Any?>? = null,
) {
if (url.isBlank()) {
log("url cannot be empty");
Expand Down Expand Up @@ -189,7 +189,7 @@ open class ParselyTracker protected constructor(siteId: String, flushInterval: I
@JvmOverloads
fun startEngagement(
url: String,
urlRef: String?,
urlRef: String? = null,
extraData: Map<String?, Any?>? = null
) {
if (url.isBlank()) {
Expand Down Expand Up @@ -253,11 +253,12 @@ open class ParselyTracker protected constructor(siteId: String, flushInterval: I
* @param videoMetadata Metadata about the video being tracked.
* @param extraData A Map of additional information to send with the event.
</CUSTOMERDOMAIN></CUSTOMERDOMAIN> */
@JvmOverloads
fun trackPlay(
url: String,
urlRef: String?,
urlRef: String? = null,
videoMetadata: ParselyVideoMetadata,
extraData: Map<String?, Any?>?
extraData: Map<String?, Any?>? = null,
) {
if (url.isBlank()) {
log("url cannot be empty");
Expand Down

0 comments on commit cad7ca2

Please sign in to comment.