Capturing keyboard shortcut outside of my MacOS app

I want to set a keyboard shortcut that can be entered from outside my app that I can receive a notification for from within my app. I found multiple ways to do this. Are there any that will work within the sandbox and allow me to submit my app to the app store without any special privileges?