android twitter4j 身份验证通过安装的 twitter 应用程序而不是浏览器 [英] android twitter4j authentication via installed twitter app not browser

查看:18
本文介绍了android twitter4j 身份验证通过安装的 twitter 应用程序而不是浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 android 应用程序中使用 twitter4j 将状态发布到 twitter,就像在这个例子中一样:http://www.androidhive.info/2012/09/android-twitter-oauth-连接教程/

i am using twitter4j in my android application to post status to twitter like in this example: http://www.androidhive.info/2012/09/android-twitter-oauth-connect-tutorial/

一切正常,但问题是:身份验证是通过浏览器完成的.有什么方法可以检测 Twitter 应用程序是否已安装在移动设备上并通过它进行身份验证?

All is working good but the question is: The authentication is done via browser .. is there any way to detect if twitter app already installed on mobile and authenticate via it ?

谢谢.

推荐答案

2014 年 11 月 27 日

EDITED: November 27, 2014

Twitter 最近发布了包含 SSO 支持的 Fabric.来自 Android 文档:

Twitter recently released Fabric that does include SSO support. From the Android docs:

尝试获取身份验证令牌时,套件将使用本地安装的 Twitter 应用程序提供单点登录体验.如果 Kit 无法通过 Twitter 应用访问身份验证令牌,它会回退到使用 Web 视图来完成 OAuth 过程.

When attempting to obtain an authentication token, the Kit will use the locally installed Twitter app to offer a single sign-on experience. If the Kit is unable to access the authentication token through the Twitter app, it falls back to using a web view to finish the OAuth process.

我的旧回复如下.

tl;博士目前,无法在 Android 上使用 Twitter 进行 SSO.

tl;dr Currently, SSO with Twitter is not possible on Android.

更长的版本:您基本上要求的是单点登录 (SSO),类似于适用于 Android 的 Facebook SDK 提供的功能.Twitter 甚至从不费心为 Android 实现自己的库,更不用说 SSO.有很多人在开发论坛(这里这里) 但标准的回应是,我引用,

Longer version: What you are basically asking for is Single sign-on (SSO), similar to what is available with the Facebook SDK for Android. Twitter has never bothered to even implement their own library for Android, let alone SSO. There are a bunch of people who have asked on the dev forums (here and here) but the standard response is, and I quote,

我们目前没有为 Android 提供与 iOS5 中可用的紧密集成级别相同的 SDK.

We do not currently offer a SDK for Android with the same level of tight integration as is available in iOS5.

Twitter 需要首先让他们的 Android 应用支持 SSO.我建议使用 FacebookGoogle+ 用于登录而不是 Twitter.

Twitter needs to first get their Android app to support SSO. I would suggest using Facebook and Google+ for login instead of Twitter.

这篇关于android twitter4j 身份验证通过安装的 twitter 应用程序而不是浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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