ios - SnapSDK 集成无法正常工作,快照显示错误:出了点问题。请稍后再试
问题描述
我遵循文档中的所有步骤并集成SnapSDK
到我的 iOS 应用程序中,但是当我单击应用程序中的共享按钮时,它会将我定向到snapchat
但最终出现错误提示
“发生错误。请稍后再试”。
private func didTapSnapchatShare(cell: FeedTableViewCell){
print("Share button tapped ")
cell.pauseVideoAndAnimation()
showProgressIndicator(view: self.view)
var watermarkStr = ""
if let userName = cell.cellDataSource?.user?.name {
watermarkStr = userName
}
let promptImage = cell.promptView?.asImage()
cell.slPlayer?.exportVideo(withWatermarkString: watermarkStr, promptImage: promptImage, completionHandler: { status, filePathURL in
DispatchQueue.main.async {
hideProgressIndicator(view: self.view)
if status, let filePathURL = filePathURL {
let url = URL(string: "snapchat://")!
if(!UIApplication.shared.canOpenURL(url)){
if let reviewURL = URL(string: "https://itunes.apple.com/us/app/snapchat/id447188370?mt=8"), UIApplication.shared.canOpenURL(reviewURL) {
if #available(iOS 10.0, *) {
UIApplication.shared.open(reviewURL, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(reviewURL)
}
return
}
}
let video = SCSDKSnapVideo(videoUrl:filePathURL)
let videoContent = SCSDKVideoSnapContent.init(snapVideo: video)
let api = SCSDKSnapAPI(content: videoContent)
api.startSnapping(completionHandler: { (error: Error?) in
print(error?.localizedDescription)
})
}
}
})
}
解决方案
推荐阅读
- python - 如何解决 django 中模型嵌套表示中的关键错误
- matlab - 使用 MATLAB 快速解包
- javascript - 在 Redux Form 中保留旧的表单样式?
- c++ - OpenMP 第一个内核比第二个内核慢得多
- android - 启动 expo 项目时“缺少 app.json”,而 app.json 已经存在
- c++ - C++,优先级队列的链表
- java - 无法在 Chrome 无头模式下运行测试
- axapta - 将 str2date 与还包含时间的字符串一起使用
- php - 来自数据库的 PHP 回显枚举类型
- python - 在 matplotlib scatter 中针对 x 和 y 绘制第三个变量?