I'm trying to create my first React Native App so I started with expo, but I have issues with componentDidMount.
From what I've seen, to allow the user to be prompted to allow notifications, locations, etc; Using componentDidMount will prompt the user at the start of the screen if they haven't been asked before. However, I want to prompt the user from a button press which I achieved with:
code to call _getLocation with button press
with this being _getLocation: _getLocation code
I can do the same thing with _getNotification and just call it on onPress within TouchableOpacity.
But would this affect future notifications? Does componentDidMount need to be initialized in render for me to send notifications in the future? Are there any ramifications in the future by doing this?
It's kinda hard to find information of this, thank you for any replies and advice.