2010-12-06 85 views
1

我在iPhone應用程序中使用MGTwitterEngine + OAuth。所有工作正常,但是當我用include_rt選項請求friends_timeline的home_timeline時,我沒有收到retweeted_status字段。「home_timeline」請求中的Twitter API「retweeted_status」字段

dev.twitter.com/doc/get/statuses/home_timeline 響應應該包含retweet的「retweeted_status」結構(如您在示例中所見)。它描述了轉推的來源推文。

dev.twitter.com/console 如果您將使用Twitter控制檯 - 您將成功獲得此結構。

但我的應用程序接收此結構爲空。像「< retweeted_status> \ n </retweeted_status>」。 除此之外,所有請求都很有效。

有沒有人看過?什麼是解決方案?

PS:我找到了這個 http://www.mail-archive.com/[email protected]/msg25383.html 和一些類似的討論,但這是瘋狂的,如果它是真的。 )

謝謝。

+0

即使我也有同樣的問題已經發布:http://stackoverflow.com/questions/4496718/retweet-using-oathmgtwitterengine-not-getting-update-response – 2011-01-31 06:55:39

回答

0

我找到了答案。它非常簡單。 SAOAuthTwitterEngine引擎使用MGTwitterEngine,但允許它使用OAuth。 但是這個引擎使用了2008年創建的MGTwitterEngine,當時MGTwitterEngine不知道「retweeted_status」,因爲這個特性後來出現了。

無論如何。 所有我需要做的 - 如果添加[的ElementName isEqualToString:@ 「retweeted_status」]案例

  • (無效)解析器:(的NSXMLParser *)theParser didStartElement:(的NSString *)的ElementName 的namespaceURI:(的NSString *)的namespaceURI的qualifiedName:(的NSString *)的qualifiedName 屬性:(的NSDictionary *)attributeDict

  • (無效)解析器:(的NSXMLParser *)theParser didEndElement:(* NSString的)的ElementName 的namespaceURI:(的NSString *)的namespaceURI的qualifiedName:(的NSString *)QNAME在MGTwitterStatusesParser.m

方法類似於[的ElementName isEqualToString:@ 「狀態」]的情況。