You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[[TMAPIClient sharedInstance] photo:@"kelvinhu.tumblr.com"
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");
}];
}
}];
}
this code can run on the simulator successfully. but when I run it on the device, the error code 400 was showed, and cannot upload the photo.
Waiting for the answer.Thanks a lot.
The text was updated successfully, but these errors were encountered:
Not sure but this doesn't sound like an SDK bug. Sounds like the response that I would expect the server to return if blue.png doesn't actually exist in the bundle.
I'd recommend using Charles Proxy to inspect the outgoing HTTP request that you're sending. If it's actually populated with image data and you're still getting a 400, it could be some problem with that image specifically.
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[TMAPIClient sharedInstance].OAuthConsumerKey = @".....";
[TMAPIClient sharedInstance].OAuthConsumerSecret = @".....";
return YES;
}
-(void)postPhoto {
[[TMAPIClient sharedInstance] authenticate:@"photopostexample" callback:^(NSError *error) {
if (error)
NSLog(@"Authentication failed: %@ %@", error, [error description]);
else {
NSLog(@"Authentication successful!");
}
this code can run on the simulator successfully. but when I run it on the device, the error code 400 was showed, and cannot upload the photo.
Waiting for the answer.Thanks a lot.
The text was updated successfully, but these errors were encountered: