I am trying to get playerid for Onesignal, while doing that it is working strangely.
onIds = async (device) => {
console.log("Device info: ", device.userId);
let playerid = device.userId;
AsyncStorage.setItem('playerid', playerid);
//this.setState({device_id: playerid})
alert(playerid);
}
the above code gives me this error, but in alert I am getting the player id. check the picture attached.
Please help me resolve this. Thanks in advance.
Like you, I tried a lot, but I could not at least not in the conventional ways, I chose to do the following, saving the ID in the BD directly from the function