ios - 我可以在新的 FBDialogs 中预选 friend 吗?
<p><p>我正在使用 <code>FBDialogs</code> 打开 <code>Facebook Messenger</code>(如果用户在设备上安装了它)发送个人消息。但是我不能在我的应用程序中预先选择 friend (信使总是给我一个列表并提示我在那里选择)。</p>
<p> <img src="/image/poNPC.jpg" alt="FB Messenger"/> </p>
<p>我正在使用 <code>presentMessageDialogWithParams:clientState:handler</code>: 接收 <a href="https://developers.facebook.com/docs/reference/ios/current/class/FBLinkShareParams/" rel="noreferrer noopener nofollow"><code>FBLinkShareParams</code> object</a> .</p>
<blockquote>
<p>FBLinkShareParams friends array </p>
<p>An array of NSStrings or <code>FBGraphUsers</code> to tag in the post. If using NSStrings, the values must represent the IDs of the users to tag.</p>
</blockquote>
<p>但是当我发送 <code>FBGraphUsers</code> 时,他们没有在 Messenger 应用程序中预先选择。他们应该吗?或者这只是一个“标记 friend ”功能?</p>
<p>我的代码:</p>
<pre><code>NSMutableArray *inviteFriends = [ init];
FBRequest* friendsRequest = ;
[friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection,
NSDictionary* result,
NSError *error) {
NSArray* friends = ;
NSLog(@"Found: %i friends", friends.count);
for (NSDictionary<FBGraphUser>* friend in friends) {
if () {
NSLog(@"I have a friend named %@ with id %@", friend.name, friend.id);
;
}
}
FBLinkShareParams *params = [ init];
params.link = ;
params.name = @"Message Dialog Tutorial";
params.caption = @"Build great social apps that engage your friends.";
params.picture = ;
params.description = @"Send links from your app using the iOS SDK.";
params.friends = inviteFriends;
// If the Facebook app is installed and we can present the share dialog
if () {
[FBDialogs presentMessageDialogWithParams:params clientState:nil handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
//
}];
}
}];
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>Messenger 会忽略“friends”和“place”参数,因为它们是专门用于标记的,而 Messenger 不支持标记。</p>
<p>您不能使用消息对话框指定要预选的用户。</p>
<p>我们将在未来更新文档以反射(reflect)这一点。</p></p>
<p style="font-size: 20px;">关于ios - 我可以在新的 FBDialogs 中预选 friend 吗?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/23607469/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/23607469/
</a>
</p>
页:
[1]