angularjs - Ionic 框架 Twitter 集成

标签 angularjs twitter ionic-framework oauth

我目前正在从事一个项目,在该项目中我必须使用 Ionic 框架进行 twitter 集成。

我正在使用来自 ionic 论坛的示例程序:http://forum.ionicframework.com/t/twitter-integration-with-jsoauth/3936

可在 bitbucket 获得:https://bitbucket.org/aaronksaunders/ionic.twitter.sample

我已经以两种方式对其进行了测试,即使用 ionic serve 和在模拟器上进行测试,但结果相同:每当我单击登录时,都会出现一个新的浏览器窗口,地址为:https://api.twitter.com/oauth/authorize ?出现包含以下错误消息。

Whoa there!
There is no request token for this page. That's the special key we need
from applications asking to use your Twitter account. Please go back to
the site or application that sent you here and try again; it was probably 
just a mistake.

我已将我的 twitter API Key 和 API Secret 放在适当的位置。

最佳答案

您应该使用 ngCordova在可能的情况。

Oauth plugin文档说明您需要使用 jsSHA 来对 Twitter 进行身份验证。

To use Twitter in your project you must have the open source library, jsSHA, included in your project. This is because Twitter requires request signing using HMAC-SHA1, not natively found in JavaScript.



ngCordova Oauth 插件文档中提供了更多信息。

关于angularjs - Ionic 框架 Twitter 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28088131/

相关文章:

node.js - 是否可以使用相同的代码库创建一个网站和混合应用程序(使用 ionic )而无需重写任何内容

javascript - $http 服务不向 Controller 返回任何内容

javascript - 如何在angular js中 trim 字符串中的字符

javascript - 如何使用 Angular JS 为 kendo ui 网格添加条件列?

java - Android 将 Arraylist 数据设置为自定义适配器

ssl - 尝试获取数据时出现 Twitter SSL 错误

javascript - Java - Rest 端点返回图像(如果可用)和 JSON(如果不可用)

javascript - Accordion 内的 Angular Dynamic ngmodel 名称

ios - 能够使用 Twitter 的 REST API 发布直接消息,但尝试 GET 会返回 401 错误

angularjs - Angular-ui-route 使用 angularJS 工厂解析