Thursday, September 29, 2022
HomeiOS Developmentandroid - The best way to fetch API knowledge through the launch...

android – The best way to fetch API knowledge through the launch display screen?


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

[NSThread sleepForTimeInterval:2.000];

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

Presently after the launch display screen my important app display screen hundreds which calls an API on mount and shows the information. It will be preferrred if I may pre-fetch the information to keep away from the wait time after the principle app display screen hundreds.

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

  useEffect(() => {

    (async operate (){

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

    })();

  }, []);

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments