<分区>
我正在 iPhone 中集成 Tumblr,但无法登录
从以下网址下载了 SDK:- https://github.com/tumblr/TMTumblrSDK
现在我想把照片上传到tumblr上
标签 ios
<分区>
我正在 iPhone 中集成 Tumblr,但无法登录
从以下网址下载了 SDK:- https://github.com/tumblr/TMTumblrSDK
现在我想把照片上传到tumblr上
最佳答案
如果您已经下载了 Tumbler SDK,那么在示例文件夹中您将看到名为“PhotoPostExample”的示例项目。
这包含以下代码。负责图片上传。
- (void)viewDidLoad {
[super viewDidLoad];
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setTitle:@"Post photo" forState:UIControlStateNormal];
[button sizeToFit];
[button addTarget:self action:@selector(postPhoto) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button];
// TODO: Fill in your keys and secrets
[TMAPIClient sharedInstance].OAuthConsumerKey = @"";
[TMAPIClient sharedInstance].OAuthConsumerSecret = @"";
[TMAPIClient sharedInstance].OAuthToken = @"";
[TMAPIClient sharedInstance].OAuthTokenSecret = @"";
}
- (void)postPhoto {
// TODO: Fill in your blog name
[[TMAPIClient sharedInstance] photo:@""
filePathArray:@[[[NSBundle mainBundle] pathForResource:@"blue" ofType:@"png"]]
contentTypeArray:@[@"image/png"]
fileNameArray:@[@"blue.png"]
parameters:@{@"caption" : @"Caption"}
callback:^(id response, NSError *error) {
if (error)
NSLog(@"Error posting to Tumblr");
else
NSLog(@"Posted to Tumblr");
}];
}
希望这对其他人有所帮助。
关于ios - 如何在 Tumblr iPhone 中发布图片或文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25707638/
相关文章:
ios - 如何找出ios中相机的焦距以及传感器高度是多少?
ios - 如何使我的键盘弹出窗口更加流畅,我的 View Controller 以模态方式出现?
ios - Cocos2d 纹理质量与内存大小 - 如何获得可接受的结果?
iOS:在后台模式下未调用 didDiscoverPeripheral
ios - 在 URLSession.shared.dataTask 期间存储来自异步闭包的数据
ios - 如何在不重新加载visibleCell的情况下重新加载collectionView上的数据
android - react native Realm 自动更新
ios - 如何在原型(prototype)单元格中使用 UIImageView 在 UITableView 中创建视差效果