删除不支持Google Play的消息

问题描述

当我未安装Google Play服务时,总是会收到此消息。

通常那完全没问题,但是既然华为不使用Google Playstore,我真的想删除该弹出窗口。每当用户打开应用程序时,我的用户都会收到此消息,这将非常烦人。

如何使弹出窗口不显示给用户?你们中有人知道此消息的来源吗?是firebase吗?

enter image description here

解决方法

您可以显示一个自定义对话框,而不是该对话框。

  private boolean checkPlayServices() {
    GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
    int resultCode = apiAvailability.isGooglePlayServicesAvailable(this);
    if (resultCode != ConnectionResult.SUCCESS) {
        if (apiAvailability.isUserResolvableError(resultCode)) {
            apiAvailability.getErrorDialog(this,resultCode,PLAY_SERVICES_RESOLUTION_REQUEST).show();
        } else {
            Log.i(TAG,"This device is not supported.");
            finish();
        }
        return false;
    }
    return true;
}

Check this link

Another way

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...