SMS Retriever Api的播放服务版本问题 [英] Play services version issue for SMS Retriever Api

查看:92
本文介绍了SMS Retriever Api的播放服务版本问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经集成了 SMS检索器Api 及其正常工作具有最新播放服务的设备上正常(已通过16.xx及更高版本的播放服务检查)

这里的问题是,如果我在具有 Play Services 11.9.xx 的设备上运行它,则SMS Retriever客户端不会注册,也不会引发任何错误,它只会跳过而无法工作!!

但是根据文档-

I have already integrated SMS Retriever Api and its working fine on devices with latest play services (checked with play services version 16.x.x and above)

The issue here is if I am running it on a device with Play Services 11.9.xx then the SMS Retriever client doesn't get registered also no error is thrown it simply skips over and doesn't work !!

But As per the docs -

先决条件- SMS Retriever API仅在具有Play功能的Android设备上可用 服务版本 10.2 及更高版本.

Prerequisites - The SMS Retriever API is available only on Android devices with Play services version 10.2 and newer.


所以它应该可以在我的设备上使用,因为播放服务大于10.2
请提出我在做什么错!

用于注册客户端的代码:


So it should have worked with my device as play services was greater than 10.2
Please suggest what I am doing wrong !!

The code used to register client :

fun setRetrieveSmsTaskListener(context: Context) {
    val client = SmsRetriever.getClient(context)
    val task = client.startSmsRetriever()
    task.addOnSuccessListener {
        LogUtils.debugLog(LOG_TAG, "Sms retriever api task Success")
    }

    task.addOnFailureListener {
        LogUtils.debugLog(LOG_TAG, "Failure Sms retriever api task with exception $it")
    }

    task.addOnCanceledListener {
        LogUtils.debugLog(LOG_TAG, "Canceled Sms retriever api task with exception")
    }
}



和使用的依赖度:



And the depencies used :

implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.google.android.gms:play-services-auth-api-phone:16.0.0'

推荐答案

使用较低版本的播放服务(如下所示),然后重试

Use lower version of play service(like below) and try again

实现'com.google.android.gms:play-services-auth-api-phone:11.0.4'

implementation 'com.google.android.gms:play-services-auth-api-phone:11.0.4'

或者如果您使用最新版本的依赖项,则在设备上更新Google Play服务版本.

Or update the google play service version on device if you are using latest version of dependencies.

这篇关于SMS Retriever Api的播放服务版本问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆