React native check internet speed
✓ Published0🌍 Public
66ewis
Last edited Jul 16, 2019
Created on Apr 5, 2022
This example shows a React Native function that measures internet speed by timing a parallel fetch of a JSON API request and a file download from a fixed test URL. Using `RNFetchBlob` for the file download and native `fetch` for the API call, it calculates kilobytes per second from the elapsed time and classifies the connection as very bad, average, good, or excellent based on thresholds like 150, 550, and 2000 kB/s. The code then triggers warning messages for each category and cleans up the cached file with `RNFetchBlob.fs.unlink`.
AI-generated description