iOS gets stuck on splash screen if no internet connection/airplane mode on.

Please provide the following:

  1. SDK Version: 38
  2. Platforms(Android/iOS/web/all): iOS

My expo application gets stuck on the splash screen when no internet connection is available. If i keep the app open and just turn off airplane mode or turn on data connection, the app loads correctly and the splash screen dissapears. This happens (until now) only in Test Flight Application. I cannot reproduce it in the iOS simulator.

I have checked the OTA options and this is how it currently looks like:

"updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": ["**/*"],
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.some.app",
      "buildNumber": "0.1.2"
    },

I have also checked with updates set to false but it still gets stuck.

Also, here is a the part that loads the resources async:

useEffect(() => {
    async function loadResourcesAndDataAsync() {
      try {
        SplashScreen.preventAutoHide()

        await Font.loadAsync({
          'Poppins Regular': require('./assets/fonts/Poppins-Regular.ttf'),
          'Poppins SemiBold': require('./assets/fonts/Poppins-SemiBold.ttf'),
        })

        await Asset.loadAsync([
          // axente
          require('./assets/photos/1.jpg'),
          require('./assets/photos/2.jpg'),

          // axente - stations
          require('./assets/photos/s1.jpg'),
          require('./assets/photos/s2.jpg'),
          require('./assets/photos/s3.jpg'),
          require('./assets/photos/s4.jpg'),

          // mosna
          require('./assets/photos/m1.jpg'),
          require('./assets/photos/m2.jpg'),

          // mosna - stations
          require('./assets/photos/ms1.jpg'),
          require('./assets/photos/ms2.jpg'),
          require('./assets/photos/ms3.jpg'),
          require('./assets/photos/ms4.jpg'),
        ])

        const result = await FileSystem.getInfoAsync(
          `${FileSystem.documentDirectory}SQLite/database.db`
        )

        console.log('res', result)

        await FileSystem.downloadAsync(
          Asset.fromModule(require('./assets/database/data.db')).uri,
          `${FileSystem.documentDirectory}SQLite/database.db`
        )
      } catch (e) {
        // We might want to provide this error information to an error reporting service
        setIsready(true)
        SplashScreen.hide()
        console.error(e)
      } finally {
        setIsready(true)
        SplashScreen.hide()
      }
    }

    loadResourcesAndDataAsync()
  }, [])

Some help would be really appreciated, also if you have some ideas of how i can see console.logs in test flight mode…

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.