Nice tip Michael! I just wanted to add something that was not immediately obvious for me.
To handle the click on that local notification, the code is already set up, since the Notifications.addListener(callback) will be fired when you tap that local notification. The only difference is it will have a remote: false property.
So, what we're doing in our app, is we pass a data params to that local notification to know what we should do:
_handleNotification=asyncnotification=>{if(notification.remote){Vibration.vibrate();constnotificationId=Notifications.presentLocalNotificationAsync({title:"Follow @technoplato",body:"To learn yourself goodly (also follow PewDiePie)",ios:{_displayInForeground:true}data:{arbitraryDataFromTheOriginalNotification:notification.arbitraryDataFromTheOriginalNotification}});}else{// Here you handle the local notification tapped, and you can access notification.data.arbitraryDataFromTheOriginalNotification}};
That way, when that notification is tapped, the
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice tip Michael! I just wanted to add something that was not immediately obvious for me.
To handle the click on that local notification, the code is already set up, since the Notifications.addListener(callback) will be fired when you tap that local notification. The only difference is it will have a
remote: false
property.So, what we're doing in our app, is we pass a
data
params to that local notification to know what we should do:That way, when that notification is tapped, the