Skip to content

Commit

Permalink
Update setUserId of FbAppender to accept nullable argument (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-garces authored Aug 10, 2021
1 parent 070dd0e commit d4f0171
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class FbAppender : IAnalyticsAppender {
firebaseAnalytics?.logEvent(FirebaseAnalytics.Event.SCREEN_VIEW, mapToBundle(parameters))
}

override fun setUserId(userId: String) {
override fun setUserId(userId: String?) {
if (firebaseAnalytics == null) {
LOG.e(LOG_TAG, "setUserId failed: firebaseAnalytics is null")
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ object Analytics {
*
* @param userID ID of the user
*/
fun setUserID(userID: String) {
fun setUserID(userID: String?) {
instance?.setUserID(userID)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class AnalyticsManager internal constructor() : IAnalyticsManager {
}
}

override fun setUserID(userID: String) {
override fun setUserID(userID: String?) {
for (appender in analyticsAppenders.values) {
appender.setUserId(userID)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ interface IAnalyticsAppender {
*
* @param userId ID of the user
*/
fun setUserId(userId: String)
fun setUserId(userId: String?)

/**
* Sets a custom property of the user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ interface IAnalyticsManager {
*
* @param userID ID of the user
*/
fun setUserID(userID: String)
fun setUserID(userID: String?)

/**
* Sets a custom property of the user
Expand Down

0 comments on commit d4f0171

Please sign in to comment.