我想分享我的应用程序到facebook这样的社交媒体平台上的帖子。
我使用了我软件包(版本1.2.0 ),我的安卓项目在Facebook共享方面运行良好。
但是,当我构建我的iOS项目时,由于以下错误,构建失败了
在SwiftFlutterShareMePlugin.swift文件的共享面板功能中。
‘'init()’已在此处显式标记为不可用(FBSDKShareKit.ShareDialog)
func sharefacebook(message:Dictionary<String,Any>, result: @escaping FlutterResult) {
let viewController = UIApplication.shared.delegate?.window??.rootViewController
let shareDialog=ShareDialog() // **this line make the error**
let shareContent = ShareLinkContent()
shareContent.contentURL = URL.init(string: message["url"] as! String)!
shareContent.quote = message["msg"] as? String
shareDialog.mode = .automatic
ShareDialog(fromViewController: viewController, content: shareContent, delegate: self).show()
result("Sucess")
}请帮我解决这个问题。
我发现,当其他开发人员试图使用类似问题包等其他软件包与Facebook分享他们的帖子时,他们也会遇到加号。
发布于 2021-11-04 06:38:59
我已经更新了SwiftFlutterShareMePlugin.swift of flutter_share_me包(Version1.2.0)文件如下,iOS项目正在为facebook共享服务。
func sharefacebook(message:Dictionary<String,Any>, result: @escaping FlutterResult) {
let viewController = UIApplication.shared.delegate?.window??.rootViewController
let shareContent = ShareLinkContent()
shareContent.contentURL = URL.init(string: message["url"] as! String)!
shareContent.quote = message["msg"] as? String
ShareDialog(viewController: viewController, content: shareContent, delegate: self).show()
result("Sucess")
}我认为问题在于FBSDKShareKit的某些功能被up版本否决了。
https://stackoverflow.com/questions/69835123
复制相似问题