Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.cornellappdev.android.eatery

import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
Expand Down Expand Up @@ -154,4 +155,9 @@ class MainActivity : ComponentActivity() {
private suspend fun configureTokens() {
authTokenRepository.getTokens()
}

override fun onNewIntent(intent: Intent) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since handleDeepLink is only called in onNewIntent and not in onCreate, would there be any issues with it not being handled if Navi tries to open the app but it is closed and not running the background? Not sure if this is the case, but you can ignore if it has been tested and works.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes in that case only onCreate is called, so I think we might need to do something like this.

super.onNewIntent(intent)
setIntent(intent)
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import androidx.navigation.compose.composable
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import androidx.navigation.navArgument
import androidx.navigation.navDeepLink
import com.cornellappdev.android.eatery.ui.components.general.AppStoreRatingPopup
import com.cornellappdev.android.eatery.ui.screens.AboutScreen
import com.cornellappdev.android.eatery.ui.screens.CompareMenusScreen
Expand Down Expand Up @@ -232,6 +233,9 @@ fun SetupNavHost(
composable(
route = "${Routes.EATERY_DETAIL.route}/{eateryId}",
arguments = listOf(navArgument("eateryId") { type = NavType.IntType }),
deepLinks = listOf(
navDeepLink { uriPattern = "eatery://eatery_detail/{eateryId}" }
),
enterTransition = {
fadeIn(
initialAlpha = 0f,
Expand Down