Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 谷歌智能锁保存对话框在Android Oreo中无法访问_C#_Google Api_Xamarin.android_Android 8.0 Oreo_Google Smartlockpasswords - Fatal编程技术网

C# 谷歌智能锁保存对话框在Android Oreo中无法访问

C# 谷歌智能锁保存对话框在Android Oreo中无法访问,c#,google-api,xamarin.android,android-8.0-oreo,google-smartlockpasswords,C#,Google Api,Xamarin.android,Android 8.0 Oreo,Google Smartlockpasswords,我知道在8.0中,自动填充是首选,但我想强制使用Google智能锁保存对话框。在实现时,我遇到以下错误: {Status{statusCode=The Credentials API's save confirmation dialog has been disabled to avoid conflicts with the Android Autofill feature. This choice may be overridden via AuthCredentialsOptions.Bu

我知道在8.0中,自动填充是首选,但我想强制使用Google智能锁保存对话框。在实现时,我遇到以下错误:

{Status{statusCode=The Credentials API's save confirmation dialog has been disabled to avoid conflicts with the Android Autofill feature. This choice may be overridden via AuthCredentialsOptions.Builder.forceEnableSaveDialog()., resolution=null}}
但在安卓系统中,没有实现这一点的方法。在谷歌搜索或文档搜索中,我找不到此
forceEnableSaveDialog()
方法

有人知道如何在8.0设备上强制执行此对话框吗?我希望我的应用程序在不同版本中表现一致

SaveCredentials代码片段:

mCredentialsApiClient = new GoogleApiClient.Builder(Xamarin.Forms.Forms.Context)
                                                                       .AddConnectionCallbacks((obj) =>
                                                                       {
                                                                           var credendial = new Credential.Builder(userName).SetPassword(password).Build();

                                                                           Auth.CredentialsApi.Save(mCredentialsApiClient, credendial).SetResultCallback(new ResultCallback<IResult>((obj2) =>
                                                                           {
                                                                               Print("Saved");
                                                                                if (obj2.Status.IsSuccess)
                                                                                {
                                                                                    Print("Credentails successfully saved with Google Smart Lock");
                                                                                }
                                                                                else if (obj2.Status.StatusCode == CommonStatusCodes.ResolutionRequired)
                                                                                {  
                                                                                    obj2.Status.StartResolutionForResult(CrossCurrentActivity.Current.Activity, obj2.Status.StatusCode);
                                                                                }
                                                                           }));
                                                                       })
                                                                       .AddOnConnectionFailedListener(NotConnected)
                                                                       .AddApi(Auth.CREDENTIALS_API)
                                                                       .Build();
                            mCredentialsApiClient.Connect(); 
mCredentialsApiClient=new-GoogleApiClient.Builder(Xamarin.Forms.Forms.Context)
.AddConnectionCallbacks((obj)=>
{
var credendial=new Credential.Builder(用户名).SetPassword(密码).Build();
Auth.CredentialsApi.Save(mCredentialsApiClient,credendial).SetResultCallback(新ResultCallback((obj2)=>
{
打印(“保存”);
if(obj2.Status.IsSuccess)
{
打印(“使用谷歌智能锁成功保存Credentails”);
}
else if(obj2.Status.StatusCode==CommonStatusCodes.ResolutionRequired)
{  
obj2.Status.StartResult解决方案(CrossCurrentActivity.Current.Activity,obj2.Status.StatusCode);
}
}));
})
.AddOnConnectionFailedListener(未连接)
.AddApi(身份验证凭据\u API)
.Build();
mCredentialsApiClient.Connect();
这是Xamarin中的Android。同样的方法和一切,只是使用C#

“…没有用于此的方法。在Google搜索或文档搜索中的任何位置都找不到此forceEnableSaveDialog()方法。”

这是由于Google Play services APK版本与其相应的客户端库发布之间存在一个窗口(结构概述)

在相应的客户端版本中,
AuthCredentialOptions.forceEnableSaveDialog()
将提供与其使用相关的文档。一旦这个问题可用,我将更新它,但您也可以观看发行说明

更新1:相应的Google Play Services客户端库已经发布。“瞄准Android O及以上版本”一节对此有更多详细信息

更新2:最新版本(11.8.0版)
AuthCredentialOptions
已被弃用,替换为新版本

“…没有用于此的方法。在Google搜索或文档搜索中的任何位置都找不到此forceEnableSaveDialog()方法。”

这是由于Google Play services APK版本与其相应的客户端库发布之间存在一个窗口(结构概述)

在相应的客户端版本中,
AuthCredentialOptions.forceEnableSaveDialog()
将提供与其使用相关的文档。一旦这个问题可用,我将更新它,但您也可以观看发行说明

更新1:相应的Google Play Services客户端库已经发布。“瞄准Android O及以上版本”一节对此有更多详细信息


更新2:最新版本(11.8.0版)
AuthCredentialOptions
已被弃用,替换为新版本

AuthCredentialsOptions.Builder的公共SDK中缺少该方法,我们修复了它(请参阅接受的答案)

但更重要的澄清是:使用Google save dialog自动填充将密码存储到同一智能锁数据库,因此如果显示自动填充对话框,则无需担心使用API强制显示另一个对话框(事实上,如果您通过API强制对话框,那么请确保禁止自动填充一个对话框…用户不应看到两个对话框)。通过任一对话框保存的数据将可用于智能锁自动登录(对于自动填充,反之亦然),并且数据通过Google帐户与Chrome(自动填充和API)同步


由于对话框将数据存储在同一个位置,因此当用户使用Google作为其自动填充管理器时,我们选择使用Google one显示自动填充,因为它将在Oreo设备上的所有应用程序中提供一致的体验。我们正致力于改进错误消息、文档和品牌,以澄清这一点。很抱歉造成混淆。

该方法AuthCredentialsOptions.Builder的公共SDK中缺少,我们修复了它(请参阅接受的答案)

但更重要的澄清是:使用Google save dialog自动填充将密码存储到同一智能锁数据库,因此,如果显示自动填充对话框,则无需担心使用API来