2

I want to measure data usage (internet) and then show to the users which how much internet they have consumed.

My app is a chat application and the messages are text, image, sticker, video, post and shares, so users can open the image, see the text, watch the videos and scroll the posts.

Why I need this.

Because we have a poor internet connection in our country so I have to make sure the users that the app is not an internet killer.

Muhammad
  • 2,572
  • 4
  • 24
  • 46
  • https://stackoverflow.com/questions/45572570/how-to-measure-the-data-usage-of-my-app-in-react-native – joy08 Mar 05 '20 at 08:59
  • Thank you I am not using any javascript library like axios I am using native module for taking and picking images, videos and downloading them. – Muhammad Mar 05 '20 at 09:04

1 Answers1

2

If you're using a JS library for networking Axios or even a builtin function (fetch) you can implement a wrapper Promise which calculates the length of any input/output string, + an approximation of the length of the header.