Is it possible to get the names or phone numbers of who texted me on iMessage using Swift or JavaScript?

I’m interested in making an iOS app that reminds me to respond every x hour whenever someone texts me. Is it possible to get that information, let’s say maybe through notifications from iMessage or directly from iMessage? I’m not looking to read the contents of the message since I know that is a privacy issue, but is it possible to retrieve who texted me and automatically sync that information with my app?

I have looked into retrieving iMessage information or notification information. It seems like iMessage contents cannot be accessed due to privacy restrictions but is it possible to just retrieve the name or phone number that texted me? It looks like it might be possible to get notification content so that can be a potential solution as well.

Thank you