Back to All

gonative_onesignal_info() doesn't work on NextJS app

According to this doc https://median.co/docs/personalized-push#programmatic-notifications
I use the way obtain oneSignalInfo from my website using declare gonative_onesignal_info()
My code is:

const [oneSignalInfoState, setOneSignalInfoState] = useState(null)
function gonative_onesignal_info(oneSignalInfo){
  setOneSignalInfoState(oneSignalInfo)
}

But in oneSignalInfoState I got nothing here. I would like to do this for save the player_id to my Database for sending notification to specific user.
What should I do now?