React Native - App stuck on splash screen after launch released iOS

Viewed 372

I uploaded my app to Play Store without any problem. However, when I tried to install the App Store, the application was rejected and I received the following message.

Guideline 2.1 - Performance - App Completeness

We discovered one or more bugs in your app. Specifically, the app displayed only a splash screen.

Review device details:

  • Device type: iPhone
  • OS version: iOS 15.1

I tried the application both on the simulator and on the real device with testflight. But I have never encountered such a problem. Does anyone know the reason or are having the same problem?

I've done almost the same application before. The only difference is that I add anonymousSignIn() in this app. Is this what broke the app or is there something else? Here my splash screen codes:

import React, { useEffect } from 'react'
import AsyncStorage from "@react-native-async-storage/async-storage"
import { View } from 'react-native'

import AppIcon from '../../assets/svgs/app-icon.svg'
import styles from './styles/SplashStyles'
import { RemoteConfig } from '../../api/RemoteConfig'
import { getData } from '../../api/RealtimeDb'
import { NotificationUtil } from "../../utils/NotificationUtil"
import { InitializeUtil } from "../../utils/InitializeUtil"
import { pushNotification } from '../../api/PushNotification';
import { anonymousSignIn } from '../../api/Auth'



const remoteConfig = new RemoteConfig()
const notificationUtil = new NotificationUtil()
const initializeUtil = new InitializeUtil()

const Splash = ({ navigation }) => {

  // asking user for notification permission (iOS)
  function permission() {
    notificationUtil.pushNotificationAPNsPermissions()
  }

  useEffect(() => {

    async function splash() {

      // fetches the remote config data from firebase
      remoteConfig.init()

      pushNotification()

      //message to be shown in the alert
      const message = remoteConfig.getAlertMessage().text

      // alert before notification permission
      await notificationUtil.alertBeforeNotificationPermission(
        message,
        permission
      )

      await anonymousSignIn()

      getData()
        .then(async (response) => {
          const lastViewedWord = await AsyncStorage.getItem("lastViewedWord")
          const page = await initializeUtil.getPageNameToVisit()
          navigation.reset({
            index: 0,
            routes: [{
              name: page, params: {
                lastViewedWord: lastViewedWord,
                allData: response,
              }
            }]
          })
        })
    }

    splash()

  }, [])



  return (
    <View style={styles.container} >
      <AppIcon
        height='100%'
        width='50%'
      />
    </View >
  )
}

export default Splash

0 Answers
Related