Shawk
Shawk copied to clipboard
Shawk Native mobile client
Currently Shawk can only send messages via an email address, Gmail in particular.
It would be wonderful if a "Shawk Native" client existed such that a regular Python Shawk Client could connect to a Shawk Native client to send and receive messages using that phone's number (instead of / in addition to SMTP & IMAP).
All this Native client would need to do is:
- Run service in background
- Obtain device permissions for SMS
- Potentially start service on device startup without need to open app
- Potentially obtain device permissions for Contacts to forward information to Shawk Client as well
- Potentially limit number of Shawk Clients allowed to communicate with it (1 seems fine)
The native client would likely just forward every received message to the Shawk client for processing and listen for messages from Shawk to reroute to actual phone contacts.
Potential implementations
While not a permanent solution, I've managed to use Shawk via Termux on an Android phone before. Maybe a shawk.Native class could be defined that could be configured at runtime to utilize native device features like true SMS and contacts? Again, this is not as native as I would like, but it may be a possibility, if only temporarily.
~~More seriously, Kivy could be key. I've never used it before, but for something as simple as forwarding text messages and opening a socket to communicate with Shawk, it should be simple enough. My biggest concern there is allowing the app to run in background, but this great blog post shows otherwise.~~
Target Platforms
I would target Android initially, since I have a small number of Android devices with which to test the app. Kivy supports iOS, but from what I understand, distributing third party apps (since I have no intention of publishing this on Apple's app store) is quite a chore. Ideally I would support iOS as well, but if it turns out to be such a pain point, I may have to wait until a collaborator shows up with an iPhone to help develop and test with.
Organization
Should Shawk stay as a monorepo and house Shawk in one folder and Shawk Native in another, or should it be split to two repos? I tend to think keeping Native in this folder would be fine, since Native won't aim to do much other than provide a middleware for Shawk to interface with and thus won't be updated much, let alone independently of Shawk.
Kivy has been a development nightmare, so I'd like to ditch all frameworks and just go straight to Android Studio. It's a small project, so it'll be perfect for getting acquainted with modern Android development.
Socket.io may be used for communicating with the Python library, since it will simplify a number of future ideas for Shawk, and it already provides a clean, standardized, and powerful socket implementation.
This looks like an opportunity for me to learn React Native and involve React Native Communications for SMS support. However, React Native does not yet have any real means for background processing as far as I can tell so this may not be feasible just yet.
react-native-background-timer may well be all that is necessary to periodically check for messages in the background. Looks like the user would need to open the app and leave it running in the background, but this should make this a possibility with react native