3

I'm using "ReadSmsManager.StartConsentAsync" and it works fine. But i have a question: Official documetation says: "Enables the service of reading SMS messages until the SMS messages that meet the rules are obtained or the service times out (the timeout duration is 5 minutes)". Can i stop this service programmatically?

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108

1 Answers1

1
  1. The ReadSmsManager class does not provide the API for proactively stopping the SM reading service.
  2. ReadSmsManager.start(this) This method is used to enable the SM reading service in the HMS Core Apk.
  3. When there is an SMS message that meets the rule, HMS Core Apk broadcasts the SMS message to your app.

Based on the preceding three points, if your app does not want to receive SMS broadcasts from HMS Core apk, you can deregister the broadcast receiver or use code to implement that the app does not perform any processing even if it receives the broadcast.

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • Thank you for your answer, but i have one more question. it's ok, if this service will continue to work, but notification about "reading verification code from sms" should not be shown. is there a way to do it? – Jack The Healer Nov 01 '21 at 07:17
  • 1
    We don't support this right now, but we will document this requirement and feed it back to the product team. Thanks for your feedback. – zhangxaochen Nov 01 '21 at 07:49