3

I am trying to implement SMS one-time code autofill service.

        SmsCodeAutofillClient smsCodeAutofillClient = SmsCodeRetriever.getAutofillClient(this);
        Task<Void> voidTask = smsCodeAutofillClient.startSmsCodeRetriever();

Everytime, this task is running into failure with the following exception: "com.google.android.gms.common.api.ApiException: 36501" and the status message as API_NOT_AVAILABLE. Google doc says the following regarding this status:

The calling application is not eligible to use this particular API.

Note: For SmsCodeAutofillClient, this status indicates that the calling application is not the current user-designated autofill service.

My question is what does this exception mean actually? What does it mean by "the calling application is not the current user-designated autofill service" ?

Shrimantee Roy
  • 317
  • 3
  • 10

1 Answers1

0

That means your app has to be an Autofill service app, besides, it needs to be selected as the device's default autofill service app, see here for the reference.

The above is the prerequisite of using this API.