Skip to content

SwiftUI: Feedback button widget invisible #5053

@frankois944

Description

@frankois944

Platform

iOS 18.x / SwiftUI / target > 17.4

Environment

Production

Installed

Swift Package Manager

Version

8.48.0

Xcode Version

16.2

Did it work on previous versions?

no

Steps to Reproduce

The widget to display the user feedback is at the wrong location in the View hierarchy by default.
Nothing is displayed

Even by triggering by action, the widget is not displayed.

@main
struct IOSApp: App {
init() {
  SentrySDK.start { options in
      ....
      options.configureUserFeedback = { config in
          config.showFormForScreenshots = true
          config.onSubmitSuccess = { data in
              print("Feedback submitted successfully: \(data)")
          }
          config.onSubmitError = { error in
              print("Failed to submit feedback: \(error)")
          }
          config.configureWidget = { widget in
              widget.autoInject = true
              widget.location = [.bottom, .trailing]
              widget.showIcon = true
              widget.windowLevel = UIWindow.Level.normal + 999999999
              widget.layoutUIOffset = .init(horizontal: 50, vertical: 50)
          }
      }
  }
}
}

As you can see in the following screenshot, the view hierarchy is weird.

The widget is declared behind the Scene.

Image
Image
Image

Expected Result

The widget button should be displayed and also the widget

Actual Result

Nothing display

Are you willing to submit a PR?

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions