-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: App -> analytics 모듈로 FIrebase init 로직 이동 (#318)
- Loading branch information
Showing
3 changed files
with
34 additions
and
36 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
android/analytics/src/main/java/poke/rogue/helper/analytics/AnalyticsInitializer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package poke.rogue.helper.analytics | ||
|
||
import com.google.firebase.analytics.ktx.analytics | ||
import com.google.firebase.crashlytics.ktx.crashlytics | ||
import com.google.firebase.ktx.Firebase | ||
|
||
object AnalyticsInitializer { | ||
fun init() { | ||
when (BuildConfig.BUILD_TYPE) { | ||
DEBUG_MODE -> { | ||
Firebase.analytics.setAnalyticsCollectionEnabled(false) | ||
Firebase.crashlytics.setCrashlyticsCollectionEnabled(false) | ||
} | ||
|
||
ALPHA_MODE -> { | ||
Firebase.analytics.setAnalyticsCollectionEnabled(false) | ||
Firebase.crashlytics.setCrashlyticsCollectionEnabled(true) | ||
} | ||
|
||
BETA_MODE, RELEASE_MODE -> { | ||
Firebase.analytics.setAnalyticsCollectionEnabled(true) | ||
Firebase.crashlytics.setCrashlyticsCollectionEnabled(true) | ||
} | ||
|
||
else -> error("Unknown build type") | ||
} | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
android/analytics/src/main/java/poke/rogue/helper/analytics/AnalyticsLogger.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters