optimalstrategy / sms_forwarder_app

An app for forwarding SMS messages
MIT License
55 stars 18 forks source link

New Feature Request. #17

Closed AidenEllis closed 2 years ago

AidenEllis commented 2 years ago

Can you please add a new feature where we can send POST request to normal http server and not ONLY WEBHOOK server.

AidenEllis commented 2 years ago

PSST! Closing the request. Just Made my own LMAO

optimalstrategy commented 2 years ago

@AidenEllis Glad you could find a solution. Out of curiosity, what do you mean by a "normal http server" and a "webhook server"? From my understanding, a webhook is just an HTTP endpoint called automatically by an external service.

AidenEllis commented 2 years ago

By normal http server i meant "REST Apis".

Webhook vs REST API

To put it simply, an API does stuff when you ask it to, while a Webhook does stuff on it's own when certain criteria is met or scenarios takes place. Webhooks on the other hand are automated calls from example.com to a server. Those calls are triggered when a specific event happens on example.com

AidenEllis commented 2 years ago

By the way, are you also thinking about adding a feature on "missing sms", like what if the device's internet connection goes off? i was thinking about it and came out with storing the incoming sms into a database and wait till the internet comes back and then forwarding those sms from the database.

Also, does you app run in background even after the app closes?

optimalstrategy commented 2 years ago

@AidenEllis I see, thank you for explaining. Although, based on what you said, I don't see a difference between a webhook and a REST API method from an external POV -- both are normal HTTP endpoints. My app allows one to choose from GET, PUT, and POST, specify URI parameters, HTTP headers, and a JSON payload to be included in the request, so you can configure what your server is going to receive.

@AidenEllis Re-sending missed SMS has been in my backlog for a while, but I'm relatively busy at work right now, so it's unlikely to land in the near future. Your idea with storing the messages in a database (probably SQLite) is pretty much what I had in mind.

As for background execution, yes, it does, but only on android. I had to switch the app to use telephony for receiving SMS, add telephony's background service to the manifest, and set up a Java service to run the app at boot. Telephony's background forwarding API requires a static function, so my app loads the configured forwarders from shared preferences.

Let me know if you have any other questions.

AidenEllis commented 2 years ago

Functionally, there is no real difference but building wise it's different. Building a Webhook and an API is way different.

Anyways, thank you for replying ;) <3