Skip to content

Commit

Permalink
setup appcenter
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopheTremblay committed Nov 7, 2023
1 parent 8ef07ba commit cafa679
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,6 @@ dependencies {
implementation(libs.koin.androidx.compose.navigation)
implementation(libs.trikot.viewmodels.databinding)
implementation(libs.trikot.vmd.compose)
"ciImplementation"(libs.appcenter)
"storeImplementation"(libs.appcenter.play)
}
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ play-services-measurement-api = "21.5.0"
androidxActivityCompose = "1.8.0"
androidxAppcompat = "1.6.1"
androidxComposeBom = "2023.10.01"
appcenter = "5.0.0"
apollo = "3.7.4"
crashlytics-plugin = "2.9.9"
killswitch = "1.0.4"
Expand Down Expand Up @@ -43,6 +44,8 @@ androidx-compose-material = { group = "androidx.compose.material", name = "mater
android-firebase-bom = { module = "com.google.firebase:firebase-bom", version.ref = "firebase" }
android-firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics-ktx" }
android-firebase-analytics = { module = "com.google.firebase:firebase-analytics-ktx" }
appcenter = { module = "com.microsoft.appcenter:appcenter-distribute", version.ref = "appcenter"}
appcenter-play = { module = "com.microsoft.appcenter:appcenter-distribute-play", version.ref = "appcenter"}
apollo-runtime = { group = "com.apollographql.apollo3", name = "apollo-runtime" }
killswitch = { module = "com.mirego.killswitch-mobile:killswitch", version.ref = "killswitch" }
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
Expand Down
1 change: 1 addition & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ target 'iosApp' do
use_frameworks!
platform :ios, $deploymentTarget
# Thirdo-party
pod 'AppCenter/Distribute'
pod 'FirebaseCore'
pod 'FirebaseAnalytics'

Expand Down
8 changes: 7 additions & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
PODS:
- AppCenter/Core (5.0.4)
- AppCenter/Distribute (5.0.4):
- AppCenter/Core
- FirebaseAnalytics (10.16.0):
- FirebaseAnalytics/AdIdSupport (= 10.16.0)
- FirebaseCore (~> 10.0)
Expand Down Expand Up @@ -88,6 +91,7 @@ PODS:
- Trikot/viewmodels.declarative.flow

DEPENDENCIES:
- AppCenter/Distribute
- FirebaseAnalytics
- FirebaseCore
- Shared (from `../shared`)
Expand All @@ -97,6 +101,7 @@ DEPENDENCIES:

SPEC REPOS:
trunk:
- AppCenter
- FirebaseAnalytics
- FirebaseCore
- FirebaseCoreInternal
Expand All @@ -122,6 +127,7 @@ CHECKOUT OPTIONS:
:tag: 5.2.0

SPEC CHECKSUMS:
AppCenter: 85c92db0759d2792a65eb61d6842d2e86611a49a
FirebaseAnalytics: 7b41efc4eba5ff841cc94d5994b5f339361258f4
FirebaseCore: 65a801af84cca84361ef9eac3fd868656968a53b
FirebaseCoreInternal: 26233f705cc4531236818a07ac84d20c333e505a
Expand All @@ -136,6 +142,6 @@ SPEC CHECKSUMS:
SwiftUIIntrospect: 53b6a16734c822804ff82c35d9073d8d8edfb085
Trikot: ca201c8ae67ff21f35a60a0bda6c600fbe51b282

PODFILE CHECKSUM: 8c6a75418b236f7d0081b7844d58c4e6b129cedb
PODFILE CHECKSUM: 85b292e2fef97a1359500ae62489551542a67efb

COCOAPODS: 1.13.0
9 changes: 9 additions & 0 deletions ios/iosApp/AppInitializer.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import AppCenter
import AppCenterDistribute
import FirebaseCore
import Foundation
import Kingfisher
Expand All @@ -7,6 +9,7 @@ import Trikot
enum AppInitializer {
static func initializeComponents(environment _: AppEnvironment) {
initializeFirebase()
initializeAppCenter()
initializeCommon()
initializeKingfisher()
inititalizeKillSwitch()
Expand All @@ -30,6 +33,12 @@ 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 initializeCommon() {
TrikotKword.shared.setCurrentLanguage(Foundation.Locale.isPreferredLanguagesFrench ? "fr" : "en")
Expand Down

0 comments on commit cafa679

Please sign in to comment.