为什么会出现这个错误? - 只读应用程序无法 POST '
Logcat:
12-05 23:37:01.721:W/System.err(534): 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
12-05 23:37:01.721: W/System.err(534): 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
12-05 23:37:01.721: W/System.err(534): error - Read-only application cannot POST
12-05 23:37:01.721: W/System.err(534): request - /1/statuses/update.json
虽然我可以通过(getScreenName()函数)读取屏幕名称并设置对我的twitter应用程序的读、写权限,但它给出了上面的logcat。而且我正在使用twitter4j jar文件。
Logcat:
12-05 23:37:01.721:W/System.err(534): 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
12-05 23:37:01.721: W/System.err(534): 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
12-05 23:37:01.721: W/System.err(534): error - Read-only application cannot POST
12-05 23:37:01.721: W/System.err(534): request - /1/statuses/update.json
Though i can read the screen name by (getScreenName() function) and set read,write permission to my twitter application , it gives the above logcat.And i am using twitter4j jar file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
重置权限后,您还必须撤销旧的权限。
https://twitter.com/settings/applications
You also have to revoke your old permission after you reset your permission.
https://twitter.com/settings/applications
添加到 @Hemangi 答案,您不必重新生成消费者密钥和秘密。在您的 Twitter 开发者门户中,转到密钥和令牌选项卡并检查访问令牌
如果显示仅使用只读权限创建,请重新生成访问令牌和密钥并更新同样在你的代码。
Adding to @Hemangi answer, you dont have to regenerate the consumer keys and secret. In your twitter developer portal go to the Keys and Tokens tab and check the access token
If it says created with only Read Only permissions, regenerate the Access Token and Secret and update the same in your code.
您是否已在 Twitter 上注册了您的应用程序以获取您的消费者密钥?
Have you registered your application with twitter to get your consumer-secret key?
只读
更改为读取+写入+发布读取直接消息
Keys and Tokens tab
并仅重新生成访问令牌和 SecretRead-only
toRead + Write + Post Read Direct Messages
Keys and Tokens tab
and regenerate only the Access token and Secret设置
选项卡中,将应用程序类型
更改为读取、写入和访问直接消息
重置键
选项卡中,按重置
按钮,相应地更新应用程序中的消费者密钥和秘密。看来重置按键会强制对应用程序类型的更改生效。
Settings
tab, change theApplication type
toRead, Write and Access direct messages
Reset keys
tab, press theReset
button, update the consumer key and secret in your application accordingly.It looks like that resetting the keys force the change to your application type to take effect.
2022 更新
所有以前发布的解决方案不再有效。以下是当前的解决方案:
仪表板(步骤 1+2)
设置(步骤 3+4)
2022 UPDATE
all previously posted solutions don't work anymore. Here is the current solutiuon:
dashboard (step 1+2)
settings (step 3+4)
转到 https://dev.twitter.com/ ->我的应用程序 -> “转到您当前的应用程序”->设置->授予“读、写和直接访问”权限 ->保存起来。之后从模拟器或设备中卸载您的项目,->清洁工程->运行项目。
希望它会有所帮助。试试这个:
Go to https://dev.twitter.com/ -> My Applications -> "go to your current application" -> Setting -> Give the permission for "Read, Write and Direct Access" -> Save it. After that uninstall your project from emulator or device, -> Clean project -> Run Project.
Hope it will helpful. try this one:
此问题应遵循的步骤。
使用
https://dev.twitter.com/apps 登录
然后转到设置
并将权限
只读
更改为读取、写入和访问私信
并更新页面。如果万一无法更新,则重新创建令牌并重试问题将得到解决。
Steps to follow for this problem.
Login with
https://dev.twitter.com/apps
and go to settings
and Change the permission
Read-only
toRead, Write and Access direct messages
and update page. and if in case not able to update then Re-Create the Token and try again problem will be solved..
您的 Twitter 应用程序可能存在问题:
写入权限可能剩余,否则会产生问题:
转到 https://dev.twitter.com/ ->我的应用程序 -> “转到您当前的应用程序”->设置->授予“读、写和直接访问”权限 ->保存起来。之后从模拟器或设备中卸载您的项目,->清洁工程->运行项目。
希望它会有所帮助:
May be issue with your twitter application:
Write Permission may remaining is it creates problem:
Go to https://dev.twitter.com/ -> My Applications -> "go to your current application" -> Setting -> Give the permission for "Read, Write and Direct Access" -> Save it. After that uninstall your project from emulator or device, -> Clean project -> Run Project.
Hope it will helpful: