如何共享铬自定义选项卡的Andr​​oid cookie数据 [英] How to share cookie data in chrome custom tabs android

查看:179
本文介绍了如何共享铬自定义选项卡的Andr​​oid cookie数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个Android应用程序,我们要开一个url.To避免用户重新输入用户名和密码,我们想通过会话cookie。我们可以使用的WebView我们的应用程序内做到这一点,但我们要避免webv​​iews。

We have an android app where we want to open a url.To avoid user re entering user name and password, we want to pass the session cookies. We can use webview inside our app to do this but we want to avoid webviews.

我们发现了另一种解决方案是采用镀铬自定义选项卡。按文件 https://developer.chrome.com/multidevice/android/customtabs 镀铬自定义选项卡支持:

Another solution we found is using chrome custom tabs. As per the documentation https://developer.chrome.com/multidevice/android/customtabs chrome custom tabs supports:

共享饼干罐和权限模型,使用户不必登录到他们已经批土地,他们已经连接到,或重新授予权限。

Shared Cookie Jar and permissions model so users don't have to log in to sites they are already connected to, or re-grant permissions they have already granted.

我从 https://github.com/GoogleChrome/custom-tabs-尝试的例子客户端但我无法弄清楚如何传递会话数据。

I am trying the example from https://github.com/GoogleChrome/custom-tabs-client But i am not able to figure out how to pass the session data.

谁能帮我通过指向文件或方式来实现这一目标?

Can anyone help me by pointing to documentation or way to achieve this ?

推荐答案

共享饼干罐意味着自定义选项卡共享饼干罐用镀铬。截至今天,这是不可能从内部的自定义选项卡的应用程序设置cookie。

The shared cookie jar means that the Custom Tab shares the cookie jar with Chrome. As of today, it is not possible to set a cookie from the application inside a Custom Tab.

在另一方面,你可能要检查对于密码,使自动登录跨应用程序和网站(并会在里面工作自定义选项卡)

On the other hand, you may want to check Smart Lock for Passwords, which enables automatic sign-in across applications and websites (and will work inside a Custom Tab)

这篇关于如何共享铬自定义选项卡的Andr​​oid cookie数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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