问题
I want to have URL for examplewww.example.com/status
in my Android app to which I will be observing and will be receiving multiple POST requests from the Server. With each POST request, I will trigger a feature. I don't understand how can I implement a listener on a URL 24x7. All I want is a place to start with. If this is not possible then is Push Notifications a viable option?
Note: The webhook isn't supposed to be on the Server instead it should be on the Client (Android) and Server is supposed to send requests on the webhook.
回答1:
You can use firebase push notification . Use a web server to send push notification to your application, and perform the action inside the Firebase Event service.
来源:https://stackoverflow.com/questions/46336811/how-do-i-implement-a-webhook-in-android