2012-10-16 52 views
3

我在上傳照片並將用戶的朋友標記到Facebook用戶的牆上時遇到問題。它返回未知錯誤無法在將照片上傳到用戶牆上時標記好友 - Facebook iOS

如果我刪除標籤參數,它將工作完美。

這是我用張貼照片和標籤的用戶

NSMutableArray *chunks = [[NSMutableArray alloc] init]; 

NSMutableDictionary *tagDict=[[NSMutableDictionary alloc]init]; 

for(int i=0; i < appDelegate.listFriend.count ;i++) { 
     NSDictionary *friend = [appDelegate.listFriend objectAtIndex:i]; 
     NSString *type = [NSString stringWithFormat:@"%@",[friend objectForKey:@"type"]]; 
     if([type intValue] == 1) { 

        [tagDict setValue:[friend objectForKey:@"id"] forKey:@"tag_uid"]; 
        [chunks addObject:tagDict]; 
     } 
} 

[photoParams setObject:[chunks JSONString] forKey:@"tags"]; 

//test posting facebook's image's url 
NSString *imagePath = urlPhoto; 
NSURL *imageUrl = [NSURL URLWithString:imagePath]; 
NSData *imageData = [NSData dataWithContentsOfURL:imageUrl]; 

NSMutableDictionary *photoParams = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
                message, @"message", imageData, @"source", nil];    

[appDelegate.facebook requestWithGraphPath:@"/me/photos" andParams:photoParams andHttpMethod:@"POST" andDelegate:appDelegate.self]; 

請幫我解決這個問題的代碼,所有的想法表示讚賞。

感謝

+0

是這個問題得到解決方案,如果是的請與我分享.... – ashokdy

回答

0

檢查此鏈接從Facebook開發人員帳戶。對我來說,它運作良好,如果你想我可以給代碼太多。

FaceBook Docs Here

相關問題