gpt4 book ai didi

ios - 使用 FacebookSDK 在 Facebook 上仅共享文本的问题

转载 作者:行者123 更新时间:2023-11-29 12:13:18 25 4
gpt4 key购买 nike

在我的应用程序中,我只想在 Facebook 上共享文本。为此,我正在使用 FacebookSDK。

我的代码如下:

NSDictionary *params = @{
@"name" :[NSString stringWithFormat:@"Jinx Share"],
@"caption" : [NSString stringWithFormat:@""],
@"description" :@"Some text to share",
@"picture" : @"",
@"link" : @"",
};


// if the session is closed, then we open it here, and establish a handler for state changes
[FBSession openActiveSessionWithReadPermissions:nil allowLoginUI:YES completionHandler:^(FBSession *session,FBSessionState state, NSError *error)
{
if (error)
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:error.localizedDescription delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
}
else if(session.isOpen)
{

// Invoke the dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:params
handler:
^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
//NSLog(@"Error publishing story.");

} else {
if (result == FBWebDialogResultDialogNotCompleted) {
//NSLog(@"User canceled story publishing.");

} else {
//NSLog(@"Story published.");

}
}}];
}

}];

但是当 facebook 共享对话框打开时,它不会在那里显示任何文本。请看下面的截图

enter image description here

如果我在“图片”参数中给出了任何链接,那么它会显示文本。但我不想显示任何图像。我只想在 Facebook 上分享文字。

我的代码有什么问题?有人可以给我解决方案。

最佳答案

自 4 月份的最新 Facebook SDK 以来,Facebook 不允许您的应用预填充任何要共享的内容。这不符合 Facebook 平台政策,see Facebook Platform Policy, 2.3 .另请参阅此 Sharing through Facebook .

关于ios - 使用 FacebookSDK 在 Facebook 上仅共享文本的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32692785/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com