Ios FBWebDialogs不显示-无反应
如果你们中有人能帮助我使用这个Facebook SDK,请告诉我。我不知道发生了什么,问题是当点击facebook上的按钮时,没有显示任何内容-FBWebDialog已死亡,但“当应用程序启动时,Xcode中的内存管理/消耗栏会分配额外的内存(约22 MB)在那之后。我遵循了官方教程:重新安装了facebook SDK,添加了AppID等东西。即使这些都没有帮助我。这有什么错 我使用的是iphone模拟器、ios 8和Xcode 6.0。大约2个月前,一切都很好。直到现在,弹出窗口还在应用程序中显示。 在此方面的任何帮助都将不胜感激 更新: 我的代码:Ios FBWebDialogs不显示-无反应,ios,iphone,xcode,facebook-sdk-3.1,Ios,Iphone,Xcode,Facebook Sdk 3.1,如果你们中有人能帮助我使用这个Facebook SDK,请告诉我。我不知道发生了什么,问题是当点击facebook上的按钮时,没有显示任何内容-FBWebDialog已死亡,但“当应用程序启动时,Xcode中的内存管理/消耗栏会分配额外的内存(约22 MB)在那之后。我遵循了官方教程:重新安装了facebook SDK,添加了AppID等东西。即使这些都没有帮助我。这有什么错 我使用的是iphone模拟器、ios 8和Xcode 6.0。大约2个月前,一切都很好。直到现在,弹出窗口还在应用程序中
[FBLoginView class];
FBLinkShareParams *params = [[FBLinkShareParams alloc] init];
params.link = [NSURL URLWithString:@"https://developers.facebook.com/docs/ios/share/"];
// If the Facebook app is installed and we can present the share dialog
if ([FBDialogs canPresentShareDialogWithParams:params]) {
// Present the share dialog
[FBDialogs presentShareDialogWithLink:params.link
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog(@"Error publishing story: %@", error.description);
} else {
// Success
NSLog(@"result %@", results);
}
}];
} else {
// Present the feed dialog
// Put together the dialog parameters
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Sharing Tutorial", @"name",
@"Build great social apps and get more installs.", @"caption",
@"Allow your users to share stories on Facebook from your app using the iOS SDK.", @"description",
@"https://developers.facebook.com/docs/ios/share/", @"link",
@"http://i.imgur.com/g3Qc1HN.png", @"picture",
nil];
// Show the feed dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:params
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog(@"Error publishing story: %@", error.description);
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// User cancelled.
NSLog(@"User cancelled.");
} else {
// Handle the publish feed callback
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:@"post_id"]) {
// User cancelled.
NSLog(@"User cancelled.");
} else {
// User clicked the Share button
NSString *result = [NSString stringWithFormat: @"Posted story, id: %@", [urlParams valueForKey:@"post_id"]];
NSLog(@"result %@", result);
}
}
}
}];
}
来自Facebook网站的标准代码,但仍然没有反应。我需要查看您的FBWebDialog代码,以便对此提供帮助。在寻求帮助时,您应该始终包含相关代码。您是否查看了代码以了解其走向(共享对话框或提要对话框?)。您是否尝试在安装了facebook应用程序的设备上运行此操作?您是否在处理程序中设置断点以查看是否调用了这些处理程序?我在模拟器上运行它。在另一个项目中,它运行正常。它进入else条件,但在那里不执行任何操作。已分配内存,但不会再发生其他操作。