我已經通過Fabric.app在項目中安裝了Twitter SDK。通過Fabric安裝Twitter,登錄工程,請求Tweets的持久性錯誤
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)")
但是當我我能當我做任何相關的請求鳴叫登錄我的Twitter賬戶,但是,我在這些print
聲明扔加入這一行viewDidLoad
我TVC
,我返回一個值:
print("Twitter.sharedInstance().sessionStore.session()?.userID is \(Twitter.sharedInstance().sessionStore.session()?.userID)")
有一個在我一個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
}
我跑通布的Twitter設置清單回覆:設置與我所做的一切,但我顯然搞亂的東西了。來自Fabric網站的示例代碼對我來說不是「開箱即用」的。任何想法:在哪裏尋找問題?我沒有想法。
我有一個問題是這樣的。它涉及我註銷並從我的Twitter帳戶設置登錄 –
謝謝。我做到了,nucked派生數據,清理緩存,重新啓動等。 – Adrian
在打電話之前是否調用了'Twitter.sharedInstance()。loginWithCompletion()'?即使您擁有有效的用戶,您仍然需要進行OAuth舞蹈才能讓您的應用程序擁有以您的名義與Twitter對話的權限。 –