[expo-splash-screen] `SplashScreen.preventAutoHideAsync()` no longer works in iOS

🐛 Bug Report

Summary of Issue

Calling SplashScreen.preventAutoHideAsync() does not prevent hiding the splash screen in expo-splash-screen@0.4.0. The splash screen automatically hides by itself.

Note that this break was introduced in 0.4.0 – it works in 0.3.1!

The issue appears on iOS only (could not reproduce in Android).

Environment – output of expo diagnostics & the platform(s) you’re targeting

  Expo CLI 3.21.13 environment info:
    System:
      OS: macOS 10.15.5
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 12.18.1 - ~/.nvm/versions/node/v12.18.1/bin/node
      Yarn: 1.22.4 - ~/Development/charisma/charisma-mobile/node_modules/.bin/yarn
      npm: 6.14.5 - ~/.nvm/versions/node/v12.18.1/bin/npm
    IDEs:
      Android Studio: 4.0 AI-193.6911.18.40.6514223
      Xcode: 11.5/11E608c - /usr/bin/xcodebuild
    npmPackages:
      react: 16.11.0 => 16.11.0
      react-native: 0.62.2 => 0.62.2

Reproducible Demo

import React from "react";
import { Text } from "react-native";
import * as SplashScreen from "expo-splash-screen";

SplashScreen.preventAutoHideAsync().catch(console.warn);

export default () => <Text>Hello world</Text>;

No warning is emitted, but the splash screen automatically hides.

Will aim to get a full repo up over the weekend!

I also feel this is related to PR #8739.

3 thoughts on “[expo-splash-screen] `SplashScreen.preventAutoHideAsync()` no longer works in iOS

  1. @bbarthec plans to investigate this soon, he is finishing up some tasks related to sdk 39 first. if anyone has time to investigate and help us diagnose the root of this problem it would be appreciated

  2. Hello guys 👋
    I’m sorry that I made you wait this long for any response 😞
    I’m diving into this problem right away 💪
    The solution proposed by the @computerjazz seems very promising 😊
    I’ll give it a try, test it and provide a PR 🤓