大佬教程收集整理的这篇文章主要介绍了ios – 通过Fabric安装的Twitter,登录工作,请求推文的持久性错误,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
print("Failed to load tweets: \(error!.localizedDescription)") print(error?.localizedFailureReason)
并得到此错误:
Failed to load tweets: request Failed: forbidden (403) Optional("Twitter API error : Unable to verify your credentials (code 99)")
但是当我将这一行添加到TVC上的viewDidLoad时,我返回一个值:
print("Twitter.sharedInstance().sessionStore.session()?.userID is \(Twitter.sharedInstance().sessionStore.session()?.userID)")
我的Info.plist中有一个Fabric条目.我没有从Fabric.app安装中更改或操作它.
在我的AppDelegate.swift的didFinishLoadingWithOptions中:
func application(application: UIApplication,didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // I tried using the consumerKey/consumerSecret for Fabric & Twitter for S's & G's to no avail Twitter.sharedInstance().startWithConsumerKey("myConsumerKey",consumerSecret: "myConsumerSecret") Fabric.with([Twitter.self()]) return true }
我通过Fabric的Twitter设置清单再次运行:设置并且我已经做了所有事情,但我显然已经搞砸了.来自Fabric网站的示例代码对我来说不是“开箱即用”的.任何想法:在哪里寻找问题?我没有想法.
let client = TWTRAPIClient() let datasource = TWTRUserTimelineDatasource(screenName: "fabric",APIClient: client)
原来他们的文档不完整,应该是这样的
let userID = Twitter.sharedInstance().sessionStore.session()?.userID let client = TWTRAPIClient(userID: userID) let datasource = TWTRUserTimelineDatasource(screenName: "fabric",APIClient: client)
客户端对象需要您的用户信息来完成它的工作.我遇到过同样的问题.
以上是大佬教程为你收集整理的ios – 通过Fabric安装的Twitter,登录工作,请求推文的持久性错误全部内容,希望文章能够帮你解决ios – 通过Fabric安装的Twitter,登录工作,请求推文的持久性错误所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。