Hi,
I am working on a habit tracking application. The main feature is to allow users to share habits. I am using a ShareLink view to allow users to send the link (using firebase to produce dynamic links).
When users press "copy" the correct link is copied to their clipboard. When a user sends the link through messages via the ShareSheet, an incorrect link is produced.
Here is the view code that grabs the URL produced for each shared habit.
ToolbarItem {
if let url = sharedHabitViewModel.shareLink(for: habitId) {
let _ = print("shared habit link unpacked: \(url)")
ShareLink(item: url, message: Text("Hey, lets hold each other accountable by completing this shared habit!")) {
Label(title: { Text("Share Habitat").foregroundColor(.primary)}, icon: {
Image(systemName: "square.and.arrow.up")
})
}
} else {
EmptyView()
}
}
This is an example of the correct link:
https://habitatdebug.page.link/jUfhKiFH7EhxB7B
Here is an example of the incorrect link:
https://habitatdebug.page.link/s?socialDescription=User+has+invited+you+to+join+habit+Exercise&socialImageUrl=https://firebasestorage.googleapis.com:443/o/appIcon%252F.png?alt%3Dmedia%26token%3D4ca8-6db1-4faa-9de8-88beb74f0db2&socialTitle=Share
I do not understand how or why the incorrect link is being produced only with the messages application.
I also receive a long list of errors when I open the ShareLink, see additional text below.