1
我想創建一個打開圖形對象,並將用戶生成的照片上載到分段資源中,以便使用它發佈操作。我正在使用iOS的最新Facebook SDK(3.5)。 的代碼如下:用戶圖像作爲打開圖形對象 - iOS
[FBRequestConnection startForUploadStagingResourceWithImage:self.image completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (!error){
NSString *uri = [result valueForKey:@"uri"];
NSMutableDictionary<FBOpenGraphObject> *object = [FBGraphObject openGraphObjectForPost];
object.provisionedForPost = YES;
object[@"type"] = @"<APP_NAME>:<OBJECT_NAME>";
object[@"url"] = uri;
object[@"title"] = @"My Title";
object[@"user_generated"] = @"true";
[FBRequestConnection startForPostOpenGraphObject:object
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
}];
}];
在startForPostOpenGraphObject
結束塊:我應該與新創建的對象的ID來電startForPostWithGraphPath
。然而,我沒有身份證,但有一個錯誤:
Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x1f2f14a0 {com.facebook.sdk:HTTPStatusCode=500, com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 1;
message = "An unknown error has occurred.";
type = OAuthException;
};
};
code = 500;
}, com.facebook.sdk:ErrorSessionKey=<FBSession: 0x1f2ca300, state: FBSessionStateOpen, loginHandler: 0x1f2cb750, appID: **************, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x1e56ed00>, expirationDate: 4001-01-01 00:00:00 +0000, refreshDate: 2013-05-08 09:07:56 +0000, `attemptedRefreshDate`: 0001-12-30 00:00:00 +0000, permissions:(
"user_photos",
"publish_stream",
"publish_actions"
)>}
我在做什麼錯?
美味的樣品非常有用。謝謝。 – 2013-05-09 09:18:23