Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

275 android push notification with deep link issue #276

Merged
4 changes: 2 additions & 2 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId = "ac.at.lbg.dhp.more"
minSdk = 29
targetSdk = 34
versionCode = 12
versionName = "4.0.14"
versionCode = 18
versionName = "4.0.18"
}
buildFeatures {
compose = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fun ContentView(viewModel: ContentViewModel) {
viewModel.openMainActivity(LocalContext.current)
} else {
MoreBackground(showBackButton = false, alertDialogModel = viewModel.alertDialogOpen.value) {
if (viewModel.loginViewScreenNr.value == 0) {
if (viewModel.loginViewScreenNr.intValue == 0) {
LoginView(model = viewModel.loginViewModel)
AppVersion()
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package io.redlink.more.app.android.activities
import android.app.Activity
import android.content.Context
import android.net.Uri
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
Expand Down Expand Up @@ -54,11 +55,12 @@ class ContentViewModel : ViewModel(), LoginViewModelListener, ConsentViewModelLi

val hasCredentials =
mutableStateOf(MoreApplication.shared!!.credentialRepository.hasCredentials())
val loginViewScreenNr = mutableStateOf(0)
val loginViewScreenNr = mutableIntStateOf(0)

val alertDialogOpen = mutableStateOf<AlertDialogModel?>(null)

init {
NavigationScreen.createDeepLinksForAllRoutes()
viewModelScope.launch(Dispatchers.IO) {
AlertController.alertDialogModel.collect {
withContext(Dispatchers.Main) {
Expand Down Expand Up @@ -134,14 +136,14 @@ class ContentViewModel : ViewModel(), LoginViewModelListener, ConsentViewModelLi

private fun showLoginView() {
viewModelScope.launch(Dispatchers.Main) {
loginViewScreenNr.value = 0
loginViewScreenNr.intValue = 0
registrationService.reset()
}
}

private fun showConsentView() {
viewModelScope.launch(Dispatchers.Main) {
loginViewScreenNr.value = 1
loginViewScreenNr.intValue = 1
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ enum class NavigationScreen(
return fullRoute
}


fun createListOfNavArguments(): List<NamedNavArgument> {
if (cachedNavArguments == null) {
cachedNavArguments = allParam().map {
Expand Down Expand Up @@ -176,5 +175,9 @@ enum class NavigationScreen(
fun allDeepLinks(deepLinkHost: String) =
entries.flatMap { it.createDeepLinkRoute(deepLinkHost).mapNotNull { it.uriPattern } }
.toSet()

fun createDeepLinksForAllRoutes() {
entries.forEach { it.createDeepLinkRoute() }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ class EndpointRepository(private val sharedStorageRepository: SharedStorageRepos
companion object {
private const val ENDPOINT_KEY = "sharedStorageEndpointKey"
private const val DATA_BASE_PATH_ENDPOINT: String =
"https://data.dev.more-health.at/api/v1"
"https://data.more-health.at/api/v1"
}
}