Toast: nothing shown on iOS while a view controller is presented over the webview

未关闭
#2,643 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@Albermonte 已经在做这个了。

开始于 2026年11月25日。

  • #2644 来自 @Albermonte —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
ios, swift

调研方向

Start with the iOS implementation of @capacitor/toast and the provided reproduction project, which shows the failure when a view controller is presented by @capacitor/browser. Compare the toast presentation path with the active view controller and use the reproduction steps to verify the behavior. Done means the toast appears over the presented controller; pull request #2644 is already open, so check its status before starting.

由索引模型根据 Issue 内容生成。

描述

platform: ios

Bug Report

Plugin(s)

@capacitor/toast 8.0.1. Same code in 8.0.2-nightly-20261124 and 9.0.0-alpha.2.

Capacitor Version
💊   Capacitor Doctor  💊

Latest Dependencies:

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

Installed Dependencies:

  @capacitor/android: not installed
  @capacitor/core: 8.6.2
  @capacitor/ios: 8.6.2
  @capacitor/cli: 8.6.2

[success] iOS looking great! 👌
Platform(s)

iOS

Current Behavior

While a view controller is presented over the webview, Toast.show() shows nothing. In the repro that view controller is @capacitor/browser; an in-app browser plugin does the same. The promise resolves right away, and no toast shows after the view controller is closed either.

Expected Behavior

The toast shows on top of the presented view controller.

Code Reproduction

https://github.com/Albermonte/capacitor-toast-presented-vc-repro

  1. pnpm install && pnpm build && npx cap sync ios && npx cap run ios
  2. Tap "1. Show toast". The toast shows.
  3. Tap "2. Open Browser, show toast after 3s". After 3 s the app calls Toast.show(). No toast appears.
  4. Close the Browser. The page shows Toast.show() called at 3.1s, resolved at 3.1s. A long toast that is on screen resolves about 4 s after the call.
Other Technical Details

Xcode 27.2, iPhone 17 simulator, iOS 27.0.

Additional Context

Same problem as #2538, which was closed without a repro. Recording of steps 3 and 4: https://github.com/Albermonte/capacitor-toast-presented-vc-repro/blob/main/media/before.mp4

主要语言
Java
星标
688
派生
690
平均合并
16 小时 15 分钟
30 天内合并 PR
7

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ionic-team/capacitor-plugins 的其他 Issue

查看 ionic-team/capacitor-plugins 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。