-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Unresolvable SMS permission prompt when submitting reports for CHT < 3.9 #322
Comments
Thank you for looking into this and sharing this feedback @jkuester |
I realized I did not mention this in the original description, but one cht-android code change I have thought of that should address this issue would be to add a check to the SMS permission request workflow to short-circuit the process if the app has not registered the This code change would be beneficial not only because it would improve compatibility with CHT |
Thanks for this update @jkuester |
@Kymoraa correct. Taking advantage of any changes made in cht-android would require re-distribution of the APKs. Honestly, either of the |
That makes sense @jkuester |
Technically no, you would not need to make any changes to the |
To recreate the behavior
1.0.0+
app using a brand that does not have theSEND_SMS
permission enabledSEND_SMS
permission enabled< 3.9.0
xml2sms
configuration setBasically, the sending report as SMS functionality is getting triggered unintentionally and this is inadvertently triggering the SMS permission request which fails because the app does not have
SEND_SMS
permission enabled.Details
Due to medic/cht-core#6162, submitting a report in cht-android for CHT versions
< 3.9.0
will always trigger an SMS record for the report to be sent regardless of thexml2sms
configuration for the form. In older versions of cht-android, if your brand was not configured with theSEND_SMS
this send-attempt would always cause an error that was handled silently by the app (but visible in the adb logs).In cht-android
1.0.0
, we updated handling for theSEND_SMS
permission to properly request permission from the user when trying to send a report via sms. BUT this only works when theSEND_SMS
permission has been configured for the app brand. The idea is that to send reports via sms this is what is needed:SEND_SMS
permission registeredxml2sms
valueUnfortunately, when connecting to a
< 3.9.0
CHT server,#2
is bypassed (because of the above-linked issue). Then, if#1
is not done (since presumably you do not want to use thexml2sms
feature), the app cannot actually request the permission from the user in#3
. When that logic fails in#3
, it falls back to re-directing the user to the Android settings to manually set the permission for the app. However, in this case, without#1
, it is actually impossible to set the permission (and no prompt is shown to the user for how to proceed). This will continue to happen each time a report is submitted.Workaround
The good news is that I have identified a workaround that does not require updates to cht-core or cht-android. To avoid experiencing this issue when using cht-android
1.0.0+
to connect to a CHT server that is< 3.9.0
, you can set thexml2sms
configuration on all your forms to"xml2sms": "false"
. (It needs to be the string"false"
and not just the boolean primitivefalse
.) This will prevent the behavior from medic/cht-core#6162 and new reports submitted for those forms will NOT trigger the SMS workflow at all.The text was updated successfully, but these errors were encountered: