我想使用 . 将一些文本和照片发布到我朋友的一个墙上FBDialog
。我有这样的方法
- (void)apiDialogFeedFriend:(NSString *)friendID :(NSString *)mImageSTR{
currentAPICall = kDialogFeedFriend;
FBSBJSON *jsonWriter = [FBSBJSON new];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
friendID, @"to",
@"I'm using the Hackbook for iOS app", @"name",
@"Hackbook for iOS.", @"caption",
@"Check out Hackbook for iOS to learn how you can make your iOS apps social using Facebook Platform.", @"description",
@"http://m.facebook.com/apps/hackbookios/", @"link",
@"http://www.facebookmobileweb.com/hackbook/img/facebook_icon_large.png", @"picture",
actionLinksStr, @"actions",
nil];
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[[delegate facebook] dialog:@"feed"
andParams:params
andDelegate:self];
}
通过这些我得到回调dialogCompleteWithUrl
方法FBDialogDelegate
。我已经像这样实现了这个委托方法:
- (void)dialogCompleteWithUrl:(NSURL *)url {
if (![url query]) {
return;
}
NSDictionary *params = [self parseURLParams:[url query]];
switch (currentAPICall) {
case kDialogFeedUser:
case kDialogFeedFriend:
{
// Successful posts return a post_id
if ([params valueForKey:@"post_id"]) {
[self showMessage:@"Published feed successfully."];
NSLog(@"Feed post ID: %@", [params valueForKey:@"post_id"]);
}
break;
}
case kDialogRequestsSendToMany:
case kDialogRequestsSendToSelect:
case kDialogRequestsSendToTarget:
{
// Successful requests return the id of the request
// and ids of recipients.
NSMutableArray *recipientIDs = [[NSMutableArray alloc] init];
for (NSString *paramKey in params) {
if ([paramKey hasPrefix:@"to["]) {
[recipientIDs addObject:[params objectForKey:paramKey]];
}
}
if ([params objectForKey:@"request"]){
NSLog(@"Request ID: %@", [params objectForKey:@"request"]);
}
if ([recipientIDs count] > 0) {
[self showMessage:@"Sent request successfully."];
NSLog(@"Recipient ID(s): %@", recipientIDs);
}
break;
}
default:
break;
}
}
在这里,我得到正确的 url 值作为fbconnect://success?post_id=100001402819851_418640698226650
.
现在,我的问题是在我的朋友墙上我的帖子看不到/可见。
任何帮助,将不胜感激。