Skip to content

Commit

Permalink
add init on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopheTremblay committed Nov 7, 2023
1 parent cafa679 commit 6e2214b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package com.mirego.kmp.boilerplate.app

import android.app.Application
import android.content.res.Configuration
import com.microsoft.appcenter.AppCenter
import com.microsoft.appcenter.distribute.Distribute
import com.microsoft.appcenter.distribute.UpdateTrack
import com.mirego.kmp.boilerplate.R
import com.mirego.kmp.boilerplate.app.bootstrap.AndroidBootstrap
import com.mirego.kmp.boilerplate.bootstrap.Bootstrapper

Expand All @@ -12,6 +16,11 @@ class AndroidApplication : Application() {
super.onCreate()
bootstrapper = Bootstrapper(AndroidBootstrap(this))
bootstrapper.initDependencies()

if (getString(R.string.appcenter_app_secret).isNotBlank()) {
Distribute.setUpdateTrack(UpdateTrack.PRIVATE)
AppCenter.start(this, getString(R.string.appcenter_app_secret), Distribute::class.java)
}
}

override fun onConfigurationChanged(newConfig: Configuration) {
Expand Down
4 changes: 4 additions & 0 deletions androidApp/src/main/res/values/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="appcenter_app_secret" translatable="false" />
</resources>

0 comments on commit 6e2214b

Please sign in to comment.