android – Easy methods to fetch API knowledge in the course of the launch display?


I’ve react native app utilizing the default template which incorporates the default launch display. In launch mode, the launch display solely confirmed for a fraction of a second so I added the under (to AppDelegate) to pressure it to pause for two seconds.

[NSThread sleepForTimeInterval:2.000];

My query is: is there a technique to name my api to load knowledge throughout this pause time?

Presently after the launch display my predominant app display masses which calls an API on mount and shows the information. It might be perfect if I may pre-fetch the information to keep away from the wait time after the principle app display masses.

That is the way in which I name my api on mount of the app:

  useEffect(() => {

    (async perform (){

         const response = await fetch('https://myapi...');
         ...
         ...

    })();

  }, []);

Leave a Reply