Skip to content

Commit

Permalink
Mirego-base-setup 6 of X: Analytics (#41)
Browse files Browse the repository at this point in the history
* Analytics stuff

* Analytics tracking

* Dummy firebase initialization

* fix

* oups

* remove comment

---------

Co-authored-by: Steven de Tilly <[email protected]>
  • Loading branch information
OlivierPineau and sdetilly authored Nov 24, 2023
1 parent 5edf22d commit f7e0e54
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ inhibit_all_warnings!
target 'iosApp' do
use_frameworks!
platform :ios, $deploymentTarget
# Thirdo-party
# Third-party
pod 'AppCenter/Distribute'
pod 'FirebaseCore'
pod 'FirebaseAnalytics'

# Multiplatform
pod 'Shared', :path => '../shared'

Expand Down
17 changes: 15 additions & 2 deletions ios/iosApp/AppInitializer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,26 @@ enum AppInitializer {

SharedAnalyticsConfiguration().analyticsManager = firebaseAnalyticsService
}

private static func initializeAppCenter() {
guard let appCenterSecret = Bundle.main.object(forInfoDictionaryKey: "APP_CENTER_APP_SECRET") as? String, !appCenterSecret.isEmpty else { return }
Distribute.updateTrack = .private
AppCenter.start(withAppSecret: appCenterSecret, services: [Distribute.self])
}

private static func initializeFirebase() {
FirebaseApp.configure()

let firebaseAnalyticsService = AnalyticsServiceImpl()
#if DEBUG
firebaseAnalyticsService.isEnabled = false
#else
firebaseAnalyticsService.isEnabled = true
#endif

SharedAnalyticsConfiguration().analyticsManager = firebaseAnalyticsService
}

private static func initializeCommon() {
TrikotKword.shared.setCurrentLanguage(Foundation.Locale.isPreferredLanguagesFrench ? "fr" : "en")
TrikotViewModelDeclarative.shared.initialize(
Expand All @@ -51,7 +64,7 @@ enum AppInitializer {
private static func initializeKingfisher() {
ImageCache.default.diskStorage.config.sizeLimit = 500 * 1_024 * 1_024 // 500 MB
}

private static func inititalizeKillSwitch() {
Task {
do {
Expand Down
32 changes: 32 additions & 0 deletions ios/iosApp/GoogleService-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANDROID_CLIENT_ID</key>
<string>123456789012-0cnvm52tlj4cn7rkfujdkuq3iq79v5ig.apps.googleusercontent.com</string>
<key>API_KEY</key>
<string>AIzaSyC3_0lgMdiPr41DjqzSWP2MqGIqIakley0</string>
<key>GCM_SENDER_ID</key>
<string>123456789012</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.mirego.kmp.boilerplate</string>
<key>PROJECT_ID</key>
<string>boilerplate-1234567890123</string>
<key>STORAGE_BUCKET</key>
<string>boilerplate-1234567890123.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:123456789012:ios:c930c9194f493843b44d0a</string>
</dict>
</plist>

0 comments on commit f7e0e54

Please sign in to comment.