Skip to content

Flickering when launching an iOS App that only supports landscape orientation from another portrait orientation App. #169913

Open
@ty0521-fss

Description

@ty0521-fss

Steps to reproduce

  1. Prepare a Flutter project. Any Flutter project will do, as this issue is source code independent.
  2. Open Runner.xcworkspace in Xcode
  3. Xcode project settings > Select Runner in TARGETS > General tab > Deployment Info, and check only Landscape Left and Landscape Right
  4. Run the app in Release Mode and install it on the iOS device (it cannot be run on the iOS simulator). After installing and launching the app, task kill the app.
  5. Configure Custom URL Schemes to launch apps from deep links in web pages using Safari
  6. Xcode project settings > Select Runner in TARGETS > Info tab > URL Types, and click the plus button to add URL Type
  7. Set the app's Bundle ID in Identifier and "myapp" in URL Schemes (the URL Schemes value can be any string, as long as it matches the deeplink in the web page you will create in the next step)
  8. Start a server to deploy web pages with deep links. It can be a local server or a remote server.
  9. Create an HTML file with deep links like the following and deploy it to the server
<html>
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width" />
    </head>
    <body>
        <p>
            <a href="myapp://">myapp</a>
        </p>
    </body>
</html>
  1. Open the deployed web page in iOS Safari (e.g. http://www.example.com/index.html)
  2. Turn the device to portrait orientation and the Safari app to portrait orientation.
  3. Tap the “myapp” deep link in the web page to launch the app. Be sure to tap the deep link while the app is not running!

For this report, I used the official Flutter sample provider_counter app.
https://github.com/flutter/samples/tree/main/provider_counter

Target platforms
iOS

Supported Destination
iPhone

Devices used in this report
iPhone 15 Pro iOS 18.5

Expected results

Flickering during application startup.

Actual results

I encountered this issue when tapping “open” in the App Store or Testflight app to launch an installed app.
It seems to occur when launching an app that only supports landscape orientation from an app that is in portrait orientation.
This problem does not occur when the web page shown in the reproduction procedure is displayed in landscape mode in Safari, the deep link is tapped, and the app is launched.
In other words, if you launch an app that only supports landscape orientation from an app that is in landscape orientation, this problem does not occur.
Also, this issue does not occur when launching an app from the Home icon.

This issue is not related to the Flutter API setPreferredOrientations, so it occurs regardless of whether or not you add code in setPreferredOrientations specifying "DeviceOrientation.landscapeLeft" and “DeviceOrientation.landscapeRight" in setPreferredOrientations.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration Launching apps from deeplink in Safari in portrait orientation. The issues occurs.
ScreenRecording_06-03-2025.14-45-42_1.mp4

Launching an app from a deep link in Safari in landscape mode. The issues not occurs.
ScreenRecording_06-03-2025.14-46-16_1.mp4

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.32.1, on macOS 15.4.1 24E263 darwin-arm64, locale ja-JP) [521ms]
    • Flutter version 3.32.1 on channel stable at /Users/home/fvm/versions/3.32.1
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b25305a883 (5 days ago), 2025-05-29 10:40:06 -0700
    • Engine revision 1425e5e9ec
    • Dart version 3.8.1
    • DevTools version 2.45.1

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1,460ms]
    • Android SDK at /Users/home/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [999ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16F6
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [11ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2) [11ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)

[✓] VS Code (version 1.100.2) [10ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.112.0

[✓] Connected device (4 available) [6.2s]
    • iPhone 15 Pro (wireless) (mobile) • 00002904-000832C92E90003C            • ios            • iOS 18.5 22F76
    • iPhone 16 Pro (mobile)            • F2BE5A9F-D21A-4AB0-97CC-587086FDFEF7 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-5 (simulator)
    • macOS (desktop)                   • macos                                • darwin-arm64   • macOS 15.4.1 24E263 darwin-arm64
    • Chrome (web)                      • chrome                               • web-javascript • Google Chrome 137.0.7151.55

[✓] Network resources [307ms]
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: layoutSystemChrome and Framework's Layout Issuesbrowser: safari-iosonly manifests in Safari on iOSfyi-engineFor the attention of Engine teamplatform-iosiOS applications specificallyplatform-webWeb applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions