Closed ertandk closed 1 year ago
Do you have \<uses-permission android:name="android.permission.RECEIVE_SMS"\/> in your Platforms/Android/AndroidManifest.xml? (It would appear that both those permissions do the same thing?)
Otherwise it won't work.
Also see this SO link: https://stackoverflow.com/questions/48634766/why-does-receive-sms-and-read-sms-permission-do-not-have-different-prompt-boxes
Do you have
in your Platforms/Android/AndroidManifest.xml? (It would appear that both those permissions do the same thing?) Otherwise it won't work.
Also see this SO link: https://stackoverflow.com/questions/48634766/why-does-receive-sms-and-read-sms-permission-do-not-have-different-prompt-boxes
Thank you for the response.
I had written the application on a different platform before, when I wrote it there, we only added the SMS.SEND permission to the Platforms/Android/AndroidManifest.xml section and sent it, and the play store verified it by asking us for evidence and accepted the application.
I just finished the project with .NET MAUI, I had to add android.permission.RECEIVE_SMS because "Relevant log output" was giving an error.
so android.permission.RECEIVE_SMS should not be written in "Platforms/Android/AndroidManifest.xml". Because PLAY STORE does not accept it. It rejects my app.
Ah, now I see the issue. When you're sending an SMS, it asks you to also have Receive permissions, but because you're not an sms application, it gets rejected.
https://github.com/dotnet/maui/blob/main/src/Essentials/src/Permissions/Permissions.android.cs#L450
It would appear that Receive SMS is a must to have?
https://github.com/dotnet/maui/blob/main/src/Essentials/src/Permissions/Permissions.android.cs#L450
It would appear that Receive SMS is a must to have?
I don't know why, but I think it shouldn't be necessary. Can I fix this value somehow?
https://github.com/dotnet/maui/blob/main/src/Essentials/src/Permissions/Permissions.android.cs#L450 It would appear that Receive SMS is a must to have?
I don't know why, but I think it shouldn't be necessary. Can I fix this value somehow?
Wait for tomorrow, see if a dev responds.
Hm yeah that seems a bit weird. I think you should be able to use send SMS without read SMS.
For a short-term solution you can declare your own permission and use that to unblock yourself. Learn more about that in our docs: https://learn.microsoft.com/dotnet/maui/platform-integration/appmodel/permissions?view=net-maui-7.0&tabs=windows#extending-permissions
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
@NonameMissingNo: Indeed, Manifest.Permission.ReceiveSms
appears to be required.
@Redth: do you remember why commit 152284f0af813f46b271044277b7df5b61128995 requires that the Manifest.Permission.ReceiveSms
permission be present in order to use SMS? Is there some reason to not just remove the requirement for Manifest.Permission.ReceiveSms
?
Added repro sample.
Sample.Issue_13446.SMS_Perimisions.zip
Emulator test did not crash with just android.permission.SEND_SMS
and nothing was added during builds.
Preparing to Test on devices right now.
find . -type f -iname "AndroidManifest.xml" -exec grep -Hni "android.permission." {} \;
./obj/Debug/net7.0-android/android/manifest/AndroidManifest.xml:11: <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
./obj/Debug/net7.0-android/android/manifest/AndroidManifest.xml:12: <uses-permission android:name="android.permission.INTERNET" />
./obj/Debug/net7.0-android/android/manifest/AndroidManifest.xml:13: <uses-permission android:name="android.permission.SEND_SMS" />
./obj/Debug/net7.0-android/android/AndroidManifest.xml:11: <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
./obj/Debug/net7.0-android/android/AndroidManifest.xml:12: <uses-permission android:name="android.permission.INTERNET" />
./obj/Debug/net7.0-android/android/AndroidManifest.xml:13: <uses-permission android:name="android.permission.SEND_SMS" />
./obj/Debug/net7.0-android/AndroidManifest.xml:9: <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
./obj/Debug/net7.0-android/AndroidManifest.xml:10: <uses-permission android:name="android.permission.INTERNET" />
./obj/Debug/net7.0-android/AndroidManifest.xml:11: <uses-permission android:name="android.permission.SEND_SMS" />
./Platforms/Android/AndroidManifest.xml:4: <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
./Platforms/Android/AndroidManifest.xml:5: <uses-permission android:name="android.permission.INTERNET" />
./Platforms/Android/AndroidManifest.xml:6: <uses-permission android:name="android.permission.SEND_SMS" />
I was able to sens SMS from sidelaoaded app on a real device, i.e only with android.permission.SEND_SMS
permission.
So, no need to add android.permission.RECEIVE_SMS
.
Improved sample. Sample.Issue_13446.SMS_Perimisions.zip
Note: Logging in UI needs refactoring to use MVVM.
Description
Hello,
I'm moving my application that I wrote on a different platform to .NET MAUI and while installing this application, SEND_SMS permission was obtained and my application was published.
But I finished my application and in the background I added SMS.SEND to AndroidManifest on android, but when I try to send SMS it asks me to add android.permission.RECEIVE_SMS permission to AndroidManifest.
But my app is not doing any reading.
My app update was denied by PLAY STORE because it requested android.permission.RECEIVE_SMS as an additional permission.
What should I do so that it doesn't ask for the RECEIVE_SMS permission?
Steps to Reproduce
When sending sms without any listening, sms listening permission is required by androidmanifest.
Link to public reproduction project repository
maui sample
Version with bug
6.0.312
Last version that worked well
6.0.312
Affected platforms
iOS, Android
Affected platform versions
All
Did you find any workaround?
If I'm only sending SMS, the SMS.SEND permission should be sufficient.
Relevant log output