ionic-team / ionic-team/ionic-framework

bug: Deep linking is broken when navigating to different tab

Open
#30,164 0 comments 0 reactions 0 assignees View on GitHub
triage
Dominant language
TypeScript
Stars
52.7k
Forks
13.3k
Avg merge
1d 15h
Merged PRs (30d)
51

Description

### Prerequisites

- [x] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#creating-an-issue).
- [x] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [x] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### Ionic Framework Version

v8.x

### Current Behavior

For more context, please refer to issue #23058.

As previously mentioned in issue #23058, Ionic does not support redirecting from `tab1 → non-tab1 → non-tab2 → tab2`. The reason given was that Ionic aims to mimic native tab behavior and does not allow programmatic navigation between different tabs.

Apart from this limitation, I am facing another issue: Suppose a user navigates to a `non-tab2` page through the flow described above. If the user then puts the app in the background and later, on the web, clicks a link intended to open `tab2`, the navigation fails. From Ionic’s perspective, this action is treated as an attempt to programmatically push a new tab, which is not supported.

This behavior causes significant issues, breaking the app in multiple scenarios and making deep linking unreliable in production environments. The problem is identical to the one described in the previous issue.

### Expected Behavior

After triggering a deep link, the app should navigate to and show the correct tab.

### Steps to Reproduce

The reproduction steps are outlined in the previous issue. The only change is the addition of the App Capacitor plugin to listen for deep links. When a deep link event occurs, the plugin pushes the page in the same manner as the button in the old reproduction.

### Code Reproduction URL

### Ionic Info

```
Ionic:

Ionic CLI : 7.2.0 (/Users/jakub/Projects/PUCWOLL/upfan/upfan-frontend/node_modules/.pnpm/@ionic+cli@7.2.0/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 8.4.2 (/Users/jakub/Projects/PUCWOLL/upfan/upfan-frontend/node_modules/.pnpm/@ionic+vue@8.4.2_patch_hash=2huitwd2pkzidtuwvzqou7uahi/node_modules/@ionic/vue)

Capacitor:

Capacitor CLI : 7.0.1
@capacitor/android : 7.0.1 (/Users/jakub/Projects/PUCWOLL/upfan/upfan-frontend/node_modules/.pnpm/@capacitor+android@7.0.1_@capacitor+core@7.0.1/node_modules/@capacitor/android)
@capacitor/core : 7.0.1 (/Users/jakub/Projects/PUCWOLL/upfan/upfan-frontend/node_modules/.pnpm/@capacitor+core@7.0.1/node_modules/@capacitor/core)
@capacitor/ios : 7.0.1 (/Users/jakub/Projects/PUCWOLL/upfan/upfan-frontend/node_modules/.pnpm/@capacitor+ios@7.0.1_@capacitor+core@7.0.1/node_modules/@capacitor/ios)

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v22.11.0 (/Users/jakub/.nvm/versions/node/v22.11.0/bin/node)
npm : 10.9.0
OS : macOS Unknown
```

### Additional Information

I attempted to modify the Ionic library to address the issue, but I was unable to resolve it, even when exposing and utilizing non-public methods like `changeTab` or `resetTab`. I understand the goal of closely matching native behavior, but this limitation presents a significant issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.