我正在使用 TikTok 的官方 SDK ( https://developers.tiktok.com/doc/video-kit-ios-video-kit-with-swift ) 将视频从我的应用程序分享到 TikTok。我使用的方法如下所示:
func openVideoShareMenu(fileUri: String) {
let request = TikTokOpenSDKShareRequest()
request.mediaType = TikTokOpenSDKShareMediaType.video
var mediaLocalIdentifiers: [String] = []
mediaLocalIdentifiers.append(fileUri)
request.localIdentifiers = mediaLocalIdentifiers
DispatchQueue.main.async {
request.send(completionBlock: { response in
print("Response from TikTok")
})
}
}
字符串fileUri
指向一个现有文件,看起来像这样/var/mobile/Containers/Data/Application/83EB0771-25A6-43A5-9F9F-B859D21DB795/Documents/exportvideo.mp4
。执行此方法时唯一发生的事情是 TikTok 应用程序打开,显示加载动画,然后立即返回到我的应用程序。在日志中,我可以看到以下输出:
realnote_app[25056:2173434] 8.8.0 - [Firebase/Analytics][I-ACS023001] Deep Link does not contain valid required params. URL params: {
"error_code" = "-4";
"error_string" = "Permissions denied";
"from_platform" = tiktoksharesdk;
"request_id" = "3BEA07B3-19EF-46F1-90B2-8E112748CEA8";
"response_id" = "51CEF72B-D265-449C-929B-372F2401AA7C";
"share_state" = 20003;
}
error_code
-4 表示Auth denied.
和20003share_state
表示Not enough permissions to operation.
但我目前正在登录 TikTok。有任何想法吗?