audio_service icon indicating copy to clipboard operation
audio_service copied to clipboard

audio_service breaks some app links when used with the app_links package [android]

Open Aulig opened this issue 10 months ago • 8 comments

Documented behaviour

Not documented.

Actual behaviour

I use the app_links package to make it so links to my website (regular https links, not deep links with a custom scheme) get opened inside the webview of the app.

Most of the time the app links work completely fine, but we noticed that when a user is at checkout and tries to log in with a magic link (login link sent via e-mail), the webview breaks (becomes either unresponsive or blank).

This is related to audio_service because the issue no longer appears when I don't inherit from AudioServiceFragmentActivity. Normally I have

class MainActivity : AudioServiceFragmentActivity() {

// with my own custom onCreate function
}

but when I use

class MainActivity: FlutterFragmentActivity()

the bug no longer occurs.

Runtime error

No error logged.

Minimal reproduction project

https://github.com/Aulig/audio_service_wv_bug

Reproduction steps

These are modified (from a regular use case) instructions so you don't have to register for an account, so they might seem a bit weird.

Do once:

  1. Send yourself an e-mail to a Gmail account that you can access on your test device. The email should include the link to the website we're showing in the WebView. You can use the link https://patriciaelias.com.br/loja/
  2. Install the app
  3. Open the app info screen (where you can uninstall the app). Scroll down to "open by default" click "Add link" and select the patriciaelias link.

Do every time you want to reproduce the error:

  1. Open the app
  2. Click "Adicionar ao carrinho" on the first product on the home page
  3. Click the green "Finalizar Pedido" button
  4. Enter "[email protected]" in the e-mail address field and click Avancar
  5. Close the app (keep it open in the background/multitasking)
  6. Go into gmail and click on the link in the e-mail you sent yourself
  7. The webview will now be frozen (doesn't react to gestures) or completely blank.
  8. To reset/fix the app afterwards, uninstall it or clear its data.

Here's a video: https://e.pcloud.link/publink/show?code=XZbyylZqnAsfBy84BL31XKAdgzQm8QxnPxV

Sorry that the steps to reproduce are so complicated, I wasn't able to simplify them further yet because I don't understand how audio_service interacts with deep linking.

Output of flutter doctor

[✓] Flutter (Channel stable, 3.27.2, on Linux Mint 22.1 6.8.0-53-generic, locale
    en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
[✗] Chrome - develop for the web (Cannot find Chrome executable at
    google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✗] Linux toolchain - develop for Linux desktop
    ✗ clang++ is required for Linux development.
      It is likely available from your distribution (e.g.: apt install clang),
      or can be downloaded from https://releases.llvm.org/
    ✗ CMake is required for Linux development.
      It is likely available from your distribution (e.g.: apt install cmake),
      or can be downloaded from https://cmake.org/download/
    ✗ ninja is required for Linux development.
      It is likely available from your distribution (e.g.: apt install
      ninja-build), or can be downloaded from
      https://github.com/ninja-build/ninja/releases
    ✗ GTK 3.0 development libraries are required for Linux development.
      They are likely available from your distribution (e.g.: apt install
      libgtk-3-dev)
[✓] Android Studio (version 2024.2)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 2 categories.

Devices exhibiting the bug

Google Pixel 3a Android 12

Aulig avatar Feb 14 '25 11:02 Aulig

This issue does not follow the issue template. If you click the "New issue" button, it should require you to answer a number of different questions.

ryanheise avatar Feb 14 '25 11:02 ryanheise

Hmm, I don't see anything like that unfortunately

Image

Aulig avatar Feb 14 '25 12:02 Aulig

Hmm, I'll have to look into that.

ryanheise avatar Feb 14 '25 12:02 ryanheise

My template chooser config file looks correct so I'm not sure what happened. Maybe it's a GitHub fault...

Anyway, the link is here:

https://ryanheise.github.io/audio_service/issue-form/issue.html

You can use it to create a new issue with all the required information in it. When you click Submit, it will take you back to GitHub where all details you entered are formatted in a GitHub issue. At this point, you can either submit that issue to GitHub or you can copy and paste the formatted issue text from there into THIS issue to avoid creating multiple issues. You can also edit your initial post above to include the required information.

ryanheise avatar Feb 14 '25 13:02 ryanheise

My template chooser config file looks correct so I'm not sure what happened. Maybe it's a GitHub fault...

Anyway, the link is here:

https://ryanheise.github.io/audio_service/issue-form/issue.html

You can use it to create a new issue with all the required information in it. When you click Submit, it will take you back to GitHub where all details you entered are formatted in a GitHub issue. At this point, you can either submit that issue to GitHub or you can copy and paste the formatted issue text from there into THIS issue to avoid creating multiple issues. You can also edit your initial post above to include the required information.

Thanks for letting me know @ryanheise ! I've updated the issue now.

Aulig avatar Feb 17 '25 14:02 Aulig

Hi @ryanheise - hope I'm not bothering you, just want to make sure that you saw the updated issue. Let me know if there's any issues with reproducing the bug. I appreciate all the work you put into this plugin.

If you have any background info on what audio_service does regarding deep linking, that'd help me with investigating the issue further too. Thank you!

Aulig avatar Feb 28 '25 10:02 Aulig

I did, I have just been busy catching up with things after having the flu for 3 weeks, so I am slowly working my way to this.

ryanheise avatar Mar 01 '25 03:03 ryanheise

Thanks for letting me know! Sorry, didn't mean to pressure you. Happy to hear you're doing better again!

Aulig avatar Mar 01 '25 06:03 Aulig