【发布时间】:2019-06-29 22:30:12
【问题描述】:
我正在尝试更新隐私参数,以便将我的应用启动的实时视频发布在用户的时间轴上,并将隐私设置为“ALL_FRIENDS”。我查看了文档,但我想出的代码不起作用:
NSString* livePath = [@"/" stringByAppendingPathComponent:[token.userID stringByAppendingPathComponent:@"live_videos"]];
FBSDKProfile *profile = [FBSDKProfile currentProfile];
if(profile.userID){
livePath = [@"/" stringByAppendingPathComponent:[profile.userID stringByAppendingPathComponent:@"live_videos"]];
}
NSMutableDictionary* param = @{
}.mutableCopy;
[param setObject:@"Test Title" forKey:@"title"];
[param setObject:@"Test Description" forKey:@"description"];
[param setObject:@"privacy" forKey:@"{@\"value\": \"ALL_FRIENDS\"}"];
[[[FBSDKGraphRequest alloc] initWithGraphPath:livePath
parameters:param
tokenString:token.tokenString
version:@"v2.6"
HTTPMethod:@"POST"]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { //More code here }
【问题讨论】:
-
用户授权应用具有特定隐私级别,您无法提高该级别以包含更多用户。
-
@luschn 正确,但是如果用户授权应用程序包含“所有人”并且我想为他们提供较低隐私级别的选项(例如:所有朋友),我该怎么做?在任何情况下都不能设置隐私吗?
-
文档是这样说的吗?你查看过 api 参考吗?
-
@luschn 当然我有 (developers.facebook.com/docs/graph-api/reference/live-video/…) 它将隐私列为您可以更新的参数,但没有显示如何或它的语法是什么的示例。
-
@luschn android 也是这样做的。 stackoverflow.com/questions/3563538/…
标签: ios objective-c facebook facebook-graph-api live-streaming