【发布时间】:2015-09-16 13:26:50
【问题描述】:
我正在开发一个本地 iOS 应用程序,我需要在其中发布到 Tumblr。
我找到了官方的 TumblrSDK (https://github.com/tumblr/TMTumblrSDK) 并决定使用它。
现在我正在测试这个 SDK,我遇到了一个问题,我可以从我的模拟器(使用 postPhotoExample 项目)将照片发布到 Tumblr,但是从我的真实 iOS 设备执行完全相同的代码会返回一个错误代码(400 - 错误请求 - 上传照片错误)
我正在运行 TumblrSDK 示例项目 (postPhoto) 中的以下代码
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"blue" ofType:@"png"];
[[TMAPIClient sharedInstance] photo:@"blogName"
filePathArray:@[filePath]
contentTypeArray:@[@"image/png"]
fileNameArray:@[@"blue.png"]
parameters:@{@"caption" : @"Test"}
callback:^(id response, NSError *error) {
if (error)
NSLog(@"Error posting to Tumblr");
else
NSLog(@"Posted to Tumblr");
}];
我知道 iOS 设备区分大小写而模拟器不区分大小写,但我发送的请求在我发送的每个帖子上看起来都完全相同。
有人遇到过类似的问题吗?
【问题讨论】:
标签: ios objective-c tumblr