gpt4 book ai didi

ios - 开始直播视频时如何更新 FBSDKGraphRequest 中的隐私参数?

转载 作者:行者123 更新时间:2023-11-29 06:02:07 24 4
gpt4 key购买 nike

我正在尝试更新隐私参数,以便我的应用启动的实时视频发布在用户的时间轴上,并将隐私设置为“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 }

最佳答案

我使用 Facebook 的图形浏览器 ( https://developers.facebook.com/tools/explorer/?method=POST&path=118477909176601%2Flive_videos&version=v3.2&privacy=%7B%27value%27%20%3A%20%27ALL_FRIENDS%27%7D&classic=0 ) 弄清楚了这一点。设置参数以更新隐私设置的代码如下。

[[[FBSDKGraphRequest alloc] initWithGraphPath:livePath
parameters:@{ @"privacy": @"{'value' : 'ALL_FRIENDS'}",}
tokenString:token.tokenString
version:@"v2.6"
HTTPMethod:@"POST"]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {

关于ios - 开始直播视频时如何更新 FBSDKGraphRequest 中的隐私参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54545687/

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