ionic-team / ionic-team/capacitor-plugins

bug: Deferred Deeplink not working and `App.getLaunchUrl()` return undefined.

Open
#2,483 11 comments 4 reactions 0 assignees View on GitHub
platform: android platform: ios
Dominant language
Java
Stars
678
Forks
685
Avg merge
4d 22h
Merged PRs (30d)
3

Description

## Bug Report

### Capacitor Version
```
💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 4.7.3
@capacitor/core: 4.7.3
@capacitor/android: 4.7.3
@capacitor/ios: 4.7.3

Installed Dependencies:

@capacitor/cli: 3.2.2
@capacitor/core: 3.2.2
@capacitor/ios: 3.2.2
@capacitor/android: 3.2.2

[success] iOS looking great! 👌
[success] Android looking great! 👌
```

### Platform(s)
Android
iOS

### Current Behavior

`App.getLaunchUrl()` return undefined.

### Expected Behavior
it should return deferred deeplink when coming from playstore or app store after installing application.

### Code Reproduction

```
async getAppLaunch(){
const launchUrl = await App.getLaunchUrl();
console.log(launchUrl)
if (launchUrl && launchUrl.url) {
// parse the launchUrl URL to extract the deep link data
const deepLinkData = new URLSearchParams(launchUrl.url.split('?')[1]);
console.log(deepLinkData.get('ddl')); // prints "mydeeplinkdata"
}
}

```

### Other Technical Details

I am implementing deferred deeplink when user clicks on my link it and they dont have app installed it will take them to respective store after installation `App.getLaunchUrl()` is not returning original clicked link.

User clicks on this link which takes them to playstore:
`https://play.google.com/store/apps/details?id=com.example.myapp&deeplinkdata=mydeeplinkdata`
after installation how can i get data in my app?
Normal deeplinks are working. if user have app installed and click any link it open my app and takes them to respective content / page.

`npm --version` output: 9.3.1

`node --version` output: v16.13.1

`pod --version` output (iOS issues only): 1.11.3

### Additional Context
i tried to setup `play.google.com` as my intent filter.
tried this ADC Command
`adb shell am start -W -a android.intent.action.VIEW -d "https://play.google.com/store/apps/details?id=com.example.myapp&ddl=mydeeplinkdata" com.example.myapp
`

Nothing is working. haven't tried on ios but i need this for iOS Too.

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.