ntpClient.getNetworkTime("pool.ntp.org", 123, (error, date) => {
if (error) {
console.error(error);
return;
}
console.log(date);
});
While on iOS simulator this works as expected (I haven't tried it on real iOS device yet), on real Android device I'm getting this error on console:
'socket-0', 'bound to address:', '0.0.0.0', 'port:', 0
'socket-0', 'closing'
Invalid Date
'socket-0', 'closed'
What can this error be due to? Notice that I set a manual date/time to test this snippet.
...
"react": "16.8.6",
"react-native": "0.60.6",
"react-native-clock-sync": "1.1.0-a",
"react-native-ntp-client": "1.0.0",
"react-native-udp": "2.6.1",
...