gpt4 book ai didi

ios - 如何预先填写在Facebook帖子中写一些文字到 friend 墙

转载 作者:行者123 更新时间:2023-12-01 16:40:22 30 4
gpt4 key购买 nike

嗨,我正在使用以下代码发布到 friend 墙,效果很好。
我想在 TextView 中预填充该文本,上面写着在 friend 的墙上写一些东西。
可以编辑吗?如果是,那怎么办?
这是代码

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",
@"100006771363037",@"to",
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 canceled.
NSLog(@"User cancelled.");
} else {
// Handle the publish feed callback
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];

if (![urlParams valueForKey:@"post_id"]) {
// User canceled.
NSLog(@"User cancelled.");

} else {
// User clicked the Share button

NSLog(@"fb web dialog result=====>%@",result);
NSString *result = [NSString stringWithFormat: @"Posted story, id: %@", [urlParams valueForKey:@"post_id"]];
NSLog(@"result %@", result);
}
}
}
}];

最佳答案

那绝对是可能的:
将 textview 的文本设置为所需的预填充文本:

textView.text = @"Allow your users to share stories on Facebook from your app using the iOS SDK.";

并将 textViews 的文本用于您要发送到 Facebook 的字典,可能通过某种自定义方法,例如
- (void)postToFacebookWithCaption:(NSString*)caption text:(NSString*)text{
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Sharing Tutorial", @"name",
caption, @"caption",
text, @"description",
@"https://developers.facebook.com/docs/ios/share/", @"link",
@"http://i.imgur.com/g3Qc1HN.png", @"picture",
@"100006771363037",@"to",
nil];

//insert code to show the feed dialog
}

关于ios - 如何预先填写在Facebook帖子中写一些文字到 friend 墙,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24959418/

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