react-native-netinfo
react-native-netinfo copied to clipboard
fix: #719 Use global delegate fixing Android TooManyRequestsException
Overview
The reason of this issue is system limits and counter.
And the cause of the issue may be that App may have created multiple RN instance and they all register network callbacks to system, mixed with that some native business also registering some callbacks, then resulted in the number of callbacks in the app goes up to the limits.
I've fixed this issue in our prt environment by registering only one network callbacks and sharing the callback from system to the other RN instances.
Test Plan
I have verified the effect and fixed the issue in our prt environment. This pr also works fine on this repository as shown by screenshots below: