Skip to content

[url_launcher] Standardize failure handling #127665

@IlyaMax

Description

@IlyaMax

Is there an existing issue for this?

Steps to reproduce

  1. use code sample provided

Expected results

we get error in catchError clause but not as "false" value

Actual results

we get "false" instead of error despite we have log of error in logs(see logs)

Code sample

Code sample
 launchUrlString(
     'viber://pa?chatURI="enter_any_chat_uri"',
      mode: LaunchMode.externalApplication,
    ).catchError(
      (obj) {
        // on android we go here and that's a correct behavior
      },
    ).then((opened) {
      // on ios we go here with opened false. we are unable to differ case when url can't be handled because there is no app
      // and case when we forbid to open it in dialog(shown when trying to open another app first time)
    }

Screenshots or Video

No response

Logs

Logs

in console we have only this log: Failed to open URL viber://pa?chatURI="enter_any_chat_uri"

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.0, on macOS 12.5.1 21G83 darwin-arm64, locale en-UA)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.76.1)```

</details>

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectfound in release: 3.10Found to occur in 3.10found in release: 3.11Found to occur in 3.11has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: requires breaking changeA change that should be batched into the next breaking change to this packagep: url_launcherPlugin to launch external applicationspackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions