iOS Tumblr Integration using oauth



试图理解这一切是如何工作的。新增 oauth 和 API 集成。不是在寻找更好的方法。希望了解并扩展其正在做什么。

我按照本教程进行操作并使其正常工作通过第 3 部分。

我有点理解,但很难将代码连接到 Tumblr API 文档。

本教程不涉及用户的访问令牌。

如何使用访问令牌在 xcode 中获取具有 api.tumblr.com/v2/user/info 的用户信息?

有了这些信息,我也许能够在脑海中形成一种理解。

代码示例将不胜感激!

@Ir100,使用您通过OAuth库生成的相同acess_token和secret_key,只需更改请求URL(API),因为每次都必须发送其他参数进行API调用。

_consumer = [[OAConsumer alloc] initWithKey: _consumerKey secret: _secretKey];
OAMutableURLRequest *request = [[OAMutableURLRequest alloc] initWithURL: url consumer: _consumer token:token realm:nil signatureProvider: nil] ;
if (!request) return;
if (self.pin.length)
    token.verifier = _pin;
[request setHTTPMethod: @"POST"];
if (_api)
[request setHTTPMethod: @"GET"];
NSMutableArray *params =  [[NSMutableArray alloc] initWithArray:request.oa_parameters];
request.oa_parameters = params;
OADataFetcher               *fetcher = [[OADataFetcher alloc] init] ;
[fetcher fetchDataWithRequest: request delegate: self didFinishSelector: success didFailSelector: fail];

最新更新