Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: vcard sharing in IOS fixed #309

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions ios/ShareViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,17 @@ class ShareViewController: SLComposeServiceViewController {
self.exit(withError: error.debugDescription)
return
}
guard let text = data as? String else {
self.exit(withError: COULD_NOT_FIND_STRING_ERROR)
guard let text = data as? NSData else{
guard let text = data as? String else {
self.exit(withError: COULD_NOT_FIND_STRING_ERROR)
return
}
self.sharedItems.append([DATA_KEY: text, MIME_TYPE_KEY: "text/plain"])
semaphore.signal()
return
}

self.sharedItems.append([DATA_KEY: text, MIME_TYPE_KEY: "text/plain"])
let url = String(data: text as Data, encoding: .utf8)
self.sharedItems.append([DATA_KEY: url, MIME_TYPE_KEY: "vcard"])
semaphore.signal()
}
}
Expand Down Expand Up @@ -246,3 +251,4 @@ class ShareViewController: SLComposeServiceViewController {
}

}