Can we get PushNotificationIOS.getInitialNotification() for Android ?
async componentDidMount (){
if(Platform.OS === "ios"){
const res = await PushNotificationIOS.getInitialNotification()
console.log("ressss", res)
}else{
// this always breaks and returns undefined
const res2 = await PushNotification.popInitialNotification();
console.log("ressss22", res2)
}
}
Hi @allindeveloper
Can you test with a callback instead of a promise ?
@Dallas62 I tried this
PushNotification.popInitialNotification((callback)=>{
console.log("ress from android ---2 ", callback.userInfo)
})
And it works perfectly, i was able to retrieve my data
Thank You
@Dallas62
And i think it would solve the initial issue i raised here...
https://github.com/zo0r/react-native-push-notification/issues/1390
I figured i could do a logic on my splash screen to check if there is any initial notification data and reroute to my desired page.
I hope this helps someone!
Hi @allindeveloper
Great news ! 馃槂
Most helpful comment
Hi @allindeveloper
Great news ! 馃槂