請參閱12月29日更新的筆記在頁面底部時畫布URL錯誤。的iOS:張貼到牆上
您好我正在做其他人的iOS項目工作(這是一種靈魂破壞,因爲他們沒有記錄他們的代碼)maintanance工作。
的問題是,用戶登錄後,試圖分享訊息到牆上總是導致
錯誤100:「帖子的鏈接必須直接到應用程序的連接或帆布URL」。
我搜索在過去的2小時,適用於iOS還沒有找到任何結果明確(但很多WordPress的,這並沒有幫助)
任何想法可能會導致此。
這裏張貼在牆上的海外開發人員代碼:
-(void)uploadPropertyDetailsOnFacebookWall
{
[FBSettings setLoggingBehavior:[NSSet setWithObjects:FBLoggingBehaviorFBRequests, FBLoggingBehaviorFBURLConnections, nil]];
NSString* photoURL = @"";
NSString *[email protected]"";
if (!kIsListOnce) {
photoURL = [currentItem objectForKey:@"Photo1FeaturedURL"];
strFullPropertyDetailLink=[currentItem objectForKey:@"FullDisplayLink"];
}
else {
strFullPropertyDetailLink=[currentItem objectForKey:@"FullDisplayLink"];
NSArray* list = [[currentItem objectForKey:@"objects"] objectForKey:@"img_small"];
;
if ([list count] > 0) {
photoURL = [list objectAtIndex:0];
}
}
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
NSString *strLinkOfApp=(NSString *)[Utils config:KiTunesstoreAppLink]; //strFullPropertyDetailLink,
NSDictionary *postParams =
[[NSMutableDictionary alloc] initWithObjectsAndKeys:
strFullPropertyDetailLink, @"link",
photoURL, @"picture",
[Utils config:kTextAgentName], @"name",
strAddress, @"caption",
[currentItem objectForKey:@"Description"], @"description",
nil];
[FBRequestConnection startWithGraphPath:@"me/feed"
parameters:postParams
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error)
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
NSString *alertText;
NSLog(@"%@",error);
if (error) {
NSDictionary *dict=[error userInfo];
NSLog(@"%@",dict);
NSDictionary *dictJSON=[dict objectForKey:@"com.facebook.sdk:ParsedJSONResponseKey"];
NSDictionary *dictBody=[dictJSON objectForKey:@"body"];
NSDictionary *dictError=[dictBody objectForKey:@"error"];
NSString *strCode=[[dictError objectForKey:@"code"] description];
if([strCode isEqualToString:@"200"])
{
alertText = @"You have not authorized the application to perform this publish action";
}else{
alertText = [@"An error ocurred: " stringByAppendingString:error.description];
alertText=[alertText stringByAppendingString: strFullPropertyDetailLink];
}
} else {
alertText = [NSString stringWithFormat:
@"Property details has been successfully shared on your Facebook Wall"];
}
[[[UIAlertView alloc] initWithTitle:@"Result"
message:alertText
delegate:nil
cancelButtonTitle:@"OK!"
otherButtonTitles:nil] show];
// Show the result in an alert
}];
}
這是我不斷收到錯誤:
Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed(com.facebook.sdk error 5.)" UserInfo=0x1d548710 {com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 100;
message = "(#100) The post's links must direct to the application's connect or canvas URL.";
type = OAuthException;
};
};
code = 400;
}, com.facebook.sdk:HTTPStatusCode=400}
2013-08-02 12:06:12.806 RealEstate[385:907] {
"com.facebook.sdk:HTTPStatusCode" = 400;
"com.facebook.sdk:ParsedJSONResponseKey" = {
body = {
error = {
code = 100;
message = "(#100) The post's links must direct to the application's connect or canvas URL.";
type = OAuthException;
};
};
code = 400;
};
}
請幫幫忙,我已經做了更多的研究在線自我最初的帖子,仍然無法找到答案。
更新12月17日:
我使用SDK 3.1.1。我想避免更新,因爲我維護着別人的代碼。
使用我/進料,在一個fbrequestconnection,任何額外paramater除了「消息」,崩潰的應用程序。
我也嘗試應用與其他堆棧溢出的用戶建議的設置鏈接到一個測試帳戶viewable here
我也禁用後流安全
其他問題
- 我錯過了將應用程序連接到Facebook的東西嗎?
- 爲什麼不會它檢測到「鏈接」參數是一樣的帆布網址是什麼?
我沒有獲得飼料對話,代碼使用SDK 3.1.1 –
我Eddited與我使用一些代碼的aswer。檢查是否可以更新sdk,儘管我相信Feed對話框在該版本中可用。 –