Skip to content

Commit

Permalink
refactor: remove on of shareInstance method in favor of `@JvmOverlo…
Browse files Browse the repository at this point in the history
…ads` annotation
  • Loading branch information
wzieba committed Dec 13, 2023
1 parent 0a8a010 commit 7b02055
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions parsely/src/main/java/com/parsely/parselyandroid/ParselyTracker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -412,18 +412,6 @@ open class ParselyTracker protected constructor(siteId: String, flushInterval: I
} else instance
}

/**
* Singleton instance factory Note: this must be called before [.sharedInstance]
*
* @param siteId The Parsely public site id (eg "example.com")
* @param c The current Android application context
* @return The singleton instance
*/
@JvmStatic
fun sharedInstance(siteId: String, c: Context): ParselyTracker? {
return sharedInstance(siteId, DEFAULT_FLUSH_INTERVAL_SECS, c)
}

/**
* Singleton instance factory Note: this must be called before [.sharedInstance]
*
Expand All @@ -433,7 +421,8 @@ open class ParselyTracker protected constructor(siteId: String, flushInterval: I
* @return The singleton instance
*/
@JvmStatic
fun sharedInstance(siteId: String, flushInterval: Int, c: Context): ParselyTracker? {
@JvmOverloads
fun sharedInstance(siteId: String, flushInterval: Int = DEFAULT_FLUSH_INTERVAL_SECS, c: Context): ParselyTracker? {
if (instance == null) {
instance = ParselyTracker(siteId, flushInterval, c)
}
Expand Down

0 comments on commit 7b02055

Please sign in to comment.