微信分享去sdk
This commit is contained in:
@@ -104,16 +104,20 @@ public final class WechatShare: SharePlatform {
|
||||
|
||||
// MARK: - 链接分享
|
||||
|
||||
/// title + desc + url 拼字符串 → UIPasteboard.string → 弹引导框。
|
||||
/// 三字段均空时用兜底文案"来自进贤聚友棋牌的精彩内容分享"(与 DouyinShare 同款策略)。
|
||||
/// title + "\n\n" + desc 拼字符串 → UIPasteboard.string → 弹引导框。
|
||||
/// 与 DouyinShare 文本分享 1:1 同款(不含 url,避免在微信对话框出现裸链接),
|
||||
/// 双侧都空时用兜底文案"来自进贤聚友棋牌的精彩内容分享"。
|
||||
private func shareLink(_ content: ShareContent) {
|
||||
var parts: [String] = []
|
||||
if !content.title.isEmpty { parts.append(content.title) }
|
||||
if !content.desc.isEmpty { parts.append(content.desc) }
|
||||
if !content.webpageUrl.isEmpty { parts.append(content.webpageUrl) }
|
||||
let shareText = parts.isEmpty
|
||||
? "来自进贤聚友棋牌的精彩内容分享"
|
||||
: parts.joined(separator: "\n")
|
||||
var shareText = ""
|
||||
if !content.title.isEmpty {
|
||||
shareText = content.title
|
||||
}
|
||||
if !content.desc.isEmpty {
|
||||
shareText = shareText.isEmpty ? content.desc : "\(shareText)\n\n\(content.desc)"
|
||||
}
|
||||
if shareText.isEmpty {
|
||||
shareText = "来自进贤聚友棋牌的精彩内容分享"
|
||||
}
|
||||
UIPasteboard.general.string = shareText
|
||||
Self.log.debug("WechatShare 链接已复制到剪贴板")
|
||||
|
||||
@@ -121,7 +125,7 @@ public final class WechatShare: SharePlatform {
|
||||
✅ 内容已复制到剪贴板
|
||||
|
||||
🎯 分享到好友、群聊或朋友圈步骤:
|
||||
1️⃣ 打开微信,选择好友、群聊或朋友圈
|
||||
1️⃣ 打开微信,选择好友、群聊或朋友圈
|
||||
2️⃣ 在输入框长按粘贴内容
|
||||
3️⃣ 点击发送即可分享
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user