Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible for apps to send SMS #71

Open
newtewt opened this issue May 29, 2019 · 8 comments
Open

Make it possible for apps to send SMS #71

newtewt opened this issue May 29, 2019 · 8 comments
Labels
SMS Type: Improvement Make something better

Comments

@newtewt
Copy link
Contributor

newtewt commented May 29, 2019

Because of restrictions to the play store and sending sms we need a way to build the android app so that the SMS sending/receiving features are removed. This should be based on flavor as some projects will need it and will have to get the app outside of the play store.

@newtewt newtewt added the Type: Improvement Make something better label May 29, 2019
@garethbowen
Copy link
Member

Nobody needs SMS right now, in part because of the draconian restrictions of the Play store, so I wonder if we remove the permission from the app for 3.5.0 and include in the flavour when it's needed.

@newtewt
Copy link
Contributor Author

newtewt commented May 30, 2019

To test medic/cht-core#4812 we need a way to enable the permission and request access. This could be done locally instead of built and sent to the app store.

@newtewt
Copy link
Contributor Author

newtewt commented May 30, 2019

I was able to build a version locally that asked for permissions using the code already there. I don't think this needs to be in 3.5.0.

@garethbowen
Copy link
Member

I agree. Moving to 3.7.0

@abbyad
Copy link
Contributor

abbyad commented Jun 11, 2019

The SMS permission android.permission.SEND_SMS is not currently in our master branch so does not need to be removed. We do however need a strategy for including the permission when needed. A suitable approach could be to include permissions on a per flavor basis, as described in this tutorial: How to Implement ProductFlavor-Dependent Permissions with Gradle.

An option to consider when the app does not have the permissions to send SMS directly would be to fall back to using the Android intents method, which would present the message to be sent in the default messaging app. There are several drawbacks to this, listed here with possible solutions:

  1. Requires user to submit the message: We could make the sending of the SMS more explicit in the app UI, so that the user is choosing to send the SMS, in which case they are likely to go through with the sending via the messaging app.
  2. Exposes the content to be viewed: This could be avoided by encoding the message so that it is not human readable, and decoding when the server receives the message.
  3. Message content could be edited: We could have a checksum or hash to detect tampering of the content.

Although the intent method is less streamlined than with the SMS permission, this may be a suitable alternative as a fallback when data connectivity is unavailable.

@abbyad abbyad changed the title SMS features need to be removed based on flavor so that we can still submit to the app store. Make it possible for individual flavors to include SMS permissions Jun 11, 2019
@abbyad
Copy link
Contributor

abbyad commented Jun 11, 2019

Just noting that the fall back to using intents should probably be split off into a separate issue, which could be scheduled separately.

cc @MaxDiz

@garethbowen
Copy link
Member

Deprioritising this while we work out how to do SMS.

@abbyad abbyad changed the title Make it possible for individual flavors to include SMS permissions Make it possible for apps to send SMS Sep 13, 2019
@abbyad
Copy link
Contributor

abbyad commented Sep 13, 2019

After discussion with @garethbowen and @yanokwa it seems as though the best plan is to create a side loaded app that handles sending SMS via an Intent. Instead of relying directly on the default messaging app, we'd explicitly call a (side-loaded) app whose sole purpose is to relay the SMS. We could optionally fall back to sending via the default messaging app if the relaying app is not present. In this case the message content would need to be converted so that is it not human-readable and contains a checksum to know if it was altered.

Some considerations:

  • The app should require very infrequent updates once installed since it will not necessarily be managed by an app store. As a result it should be as small and simple as possible to reduce complexity and defects.
  • The app will need to reliably send SMS, despite Android restricting activity of background apps and services to increase battery life.
  • It is preferable to not have a UI since UX should be handled by the calling app, and UI elements may require translations (and updates!). That said, a UI element like a notification would be acceptable if required to have the app/service run by Android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SMS Type: Improvement Make something better
Projects
None yet
Development

No branches or pull requests

4 participants