How to measure the data usage of my app in react native?
Asked Answered
E

1

14

I have a react-native app that I want to measure the data usage per user and gather them to optimize it later.

I saw old questions for native android suggesting that trafficStats may give stats by UUID.

What possibilities are there for react-native?

Exosphere answered 8/8, 2017 at 15:37 Comment(0)
F
12

Using react-native means that you have two options,

  1. The native implementation which depends on the OS you're working on.

  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.

Firstclass answered 7/11, 2017 at 9:47 Comment(2)
But we are also downloading video files, does this apply to them too?Overlive
Also, please check here: github.com/react-native-netinfo/react-native-netinfo/issues/388Overlive

© 2022 - 2024 — McMap. All rights reserved.