sa3dany / android-sms-hooks

Webhooks for SMS. Sends a POST request to a custom endpoint each time you receive an SMS message
Mozilla Public License 2.0
52 stars 16 forks source link

is there a minimum android version? #5

Open krtschmr opened 2 years ago

sa3dany commented 2 years ago

I guess the hard requirement is SDK version 30 (Android 11) which is required by WorkManager.

krtschmr commented 2 years ago

@sa3dany so i assume this phone https://www.amazon.de/gp/product/B09CKZ4HY5 won't work with this app? I'm asking since twilio isn't reliable anymore for me (the sender to blame, not twilio), so i'm in need to capture sms now from my sim card, rather than twilio and forward them to my server API to process the content. i thought i just buy a cheap android and get this running. any recommendations on a smart phone? cheapest one is enough for me. also: does this app run in background 24/7 or do i need to have it "open" all the time ( would put phone in the corner anyways, as it's sole purpose is to forward incoming SMS to my server)

krtschmr commented 2 years ago

https://www.amazon.de/dp/B08FX96PDP this one would be android 11, i assume i can install the app then on there and have peace in mind? ✌🏿

sa3dany commented 2 years ago

Hi, Don't know why the WorkManager page says that SDK version 30 is the minimum, I think it works reliably with SDK version 29 too (Android 10) according to the code samples used by Google. This sample even lists SDK version 21 as the minimum (I don't know if the implementation is as reliable as newer SDK version though)

krtschmr commented 2 years ago

i guess, price wise, it's either 65 EUR for android 8 phones or 100 EUR for android 11 phones. So i'm okay with buyin an 11 then. The most important thing is that all incoming sms will be forwarded reliable.

Does this app work 24/7 in the background? i read something that background apps are paused somehow by android, but since i'm a rails developer, i don't know much about phones

sa3dany commented 2 years ago

No, it uses WorkManager to schedule tasks. The tasks run when there is an active network connection. There is currently no support for retries so if the network request made by the app failes for any reason (for example if the server returns a non-succes status code), that sms won't be retried again.

krtschmr commented 2 years ago

That's no problem, same for twilio. They won't resend. however i have 99.xx% uptime, so my server receives everything. if something slips through (once a year), i don't mind.

I was more interested if this app is reliable on an android device. I guess i'll just order that phone as listed above and will try it out then on tuesday. #exciting.

sa3dany commented 2 years ago

You will also need to whitelist the app through any vendor specific battery optimization features to prevent the OS from freezing the app indefinitely until you reopen it.

As for reliability that's why I made the app after trying a number of other apps which would always stop sending the sms messages after some time.I haven't tried any other app since 2019 so I am not sure if the other available apps still have this issue.

The magic is the WorkManager which does the scheduling. So if you are worried about reliability you might look on how the work manager is implemented in the SDK version of the phone you will decide to buy.

krtschmr commented 2 years ago

This sounds like i should go the RaspberryPI route with a Sim module ;-)

I have ordered this phone now and if it doesn't work, i'll simply send it back. It's also okay for me to restart the phone every 2 weeks or so, if that's required. Since i haven't used android in forever, this is very new to me. Thank you for your input, appreciated.

sa3dany commented 2 years ago

No problem. Why would you need to restart the phone?

krtschmr commented 2 years ago

prevent the OS from freezing the app indefinitely until you reopen it.

I was irritated by this comment. I assume it meant it's okay for me to restart the app. I'll post a trip report by next weekend. :-)

sa3dany commented 2 years ago

I actually meant the OS will freeze the app. This is usually okay for other app with regular user interaction since the OS just unfreezes the app, but since this is an set and forget kind of app with no further need to open the launcher activity, the OS battery saving feature will after some time freeze the app since it assumes the app is unused.

This is why you have to whitelist the app from battery saving.

krtschmr commented 2 years ago

Thanks for that info. It's the only app running on that phone. I'll then have a look for it and whitelist it accordingly.

Appreciated 🤝