Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check for slow/low network in ios app

Can anyone suggest how to handle a slow network when streaming video in a web view?

When the network strength is poor, a blank screen appears or video doesn't stream.

Is there a way to detect this condition so that we can alert the user? (Apart from using private API.)

like image 751
user1722128 Avatar asked Oct 05 '12 06:10

user1722128


1 Answers

Perhaps ifi_baudrate member of the if_data structure (declared in <net/if.h>) is what you need. If baudrate is less than some threshold value, then you can show an alert. Please see the following answer to know how to obtain the if_data structure for a particular network interface: https://stackoverflow.com/a/8014012/1310204

like image 154
Nikolay Mamaev Avatar answered Oct 07 '22 01:10

Nikolay Mamaev