Add iOS share extension with rich link previews

- Implement share extension to receive URLs from other apps
- Display shared links with emoji indicator and rich preview cards
- Add custom compact link preview with image, title, and domain
- Configure app groups for data sharing between extension and main app
- Handle URL detection and parsing in share extension
- Update message formatting to show only emoji for shared links
- Add proper entitlements and activation rules for share extension
This commit is contained in:
jack
2025-07-08 17:47:53 +02:00
parent b8d930614e
commit d5ccf6bc0b
9 changed files with 369 additions and 118 deletions
+7 -2
View File
@@ -433,11 +433,16 @@ struct ContentView: View {
// Check for links and show preview
if let markdownLink = message.content.extractMarkdownLink() {
LinkPreviewView(url: markdownLink.url, title: markdownLink.title)
.padding(.top, 4)
// Don't show link preview if the message is just the emoji
let cleanContent = message.content.trimmingCharacters(in: .whitespacesAndNewlines)
if cleanContent.hasPrefix("👇") {
LinkPreviewView(url: markdownLink.url, title: markdownLink.title)
.padding(.top, 4)
}
} else {
// Check for plain URLs
let urls = message.content.extractURLs()
let _ = urls.isEmpty ? nil : print("DEBUG: Found \(urls.count) plain URLs in message")
ForEach(urls.prefix(3), id: \.url) { urlInfo in
LinkPreviewView(url: urlInfo.url, title: nil)
.padding(.top, 4)