Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions example/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
"postinstall": "patch-package"
},
"dependencies": {
"expo": "54.0.7",
"expo": "^54.0.10",
"expo-dev-client": "~6.0.12",
"expo-linking": "~8.0.8",
"expo-splash-screen": "~31.0.10",
"expo-status-bar": "~3.0.8",
"expo-updates": "~29.0.10",
"expo-updates": "~29.0.11",
"patch-package": "^8.0.0",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-native": "0.81.4",
"react-native": "0.81.5",
"react-native-web": "^0.21.0"
},
"devDependencies": {
Expand Down
1,823 changes: 0 additions & 1,823 deletions example/basic/patches/expo-modules-autolinking+3.0.10.patch

This file was deleted.

1,647 changes: 885 additions & 762 deletions example/basic/yarn.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions example/expo-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
},
"dependencies": {
"@expo/metro-runtime": "~6.1.2",
"expo": "54.0.7",
"expo-constants": "~18.0.8",
"expo": "54.0.22",
"expo-constants": "~18.0.10",
"expo-linking": "~8.0.8",
"expo-router": "~6.0.5",
"expo-router": "~6.0.14",
"expo-splash-screen": "~31.0.10",
"expo-status-bar": "~3.0.8",
"patch-package": "^8.0.0",
"react": "19.1.0",
"react-native": "0.81.4",
"react-native": "0.81.5",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0"
},
Expand Down
1,823 changes: 0 additions & 1,823 deletions example/expo-router/patches/expo-modules-autolinking+3.0.10.patch

This file was deleted.

1,547 changes: 837 additions & 710 deletions example/expo-router/yarn.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions example/react-navigation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"@react-navigation/native": "^7.0.2",
"@react-navigation/native-stack": "^7.0.2",
"@react-navigation/stack": "^7.0.2",
"expo": "54.0.7",
"expo": "54.0.22",
"expo-linking": "~8.0.8",
"expo-splash-screen": "~31.0.10",
"expo-status-bar": "~3.0.8",
"patch-package": "^8.0.0",
"react": "19.1.0",
"react-native": "0.81.4",
"react-native": "0.81.5",
"react-native-gesture-handler": "~2.28.0",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0"
Expand Down
1,823 changes: 0 additions & 1,823 deletions example/react-navigation/patches/expo-modules-autolinking+3.0.10.patch

This file was deleted.

1,689 changes: 910 additions & 779 deletions example/react-navigation/yarn.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
"dependencies": {
"@expo/config-plugins": "~10.1.1",
"expo-constants": "~17.1.7",
"expo-constants": "~18.0.8",
"expo-linking": "~7.1.7"
},
"resolutions": {
Expand Down
31 changes: 31 additions & 0 deletions plugin/src/ios/ShareExtensionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ShareViewController: UIViewController {
let fileURLType: String = UTType.fileURL.identifier
let pkpassContentType: String = "com.apple.pkpass"
let pdfContentType: String = UTType.pdf.identifier
let vcardContentType: String = "public.vcard"

override func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -44,6 +45,8 @@ class ShareViewController: UIViewController {
await handleImages(content: content, attachment: attachment, index: index)
} else if attachment.hasItemConformingToTypeIdentifier(videoContentType) {
await handleVideos(content: content, attachment: attachment, index: index)
} else if attachment.hasItemConformingToTypeIdentifier(vcardContentType) {
await handleVCard(content: content, attachment: attachment, index: index)
} else if attachment.hasItemConformingToTypeIdentifier(fileURLType) {
await handleFiles(content: content, attachment: attachment, index: index)
} else if attachment.hasItemConformingToTypeIdentifier(pkpassContentType) {
Expand All @@ -64,6 +67,33 @@ class ShareViewController: UIViewController {
}
}

private func handleVCard(content: NSExtensionItem, attachment: NSItemProvider, index: Int) async {
Task.detached {
do {
if let url = try? await attachment.loadItem(forTypeIdentifier: self.vcardContentType) as? URL {
// ensure a .vcf file extension so mime resolves properly
let tmp = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString + ".vcf")
_ = self.copyFile(at: url, to: tmp)
Task { @MainActor in
await self.handleFileURL(content: content, url: tmp, index: index)
}
} else if let data = try? await attachment.loadItem(forTypeIdentifier: self.vcardContentType) as? Data {
let tmp = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString + ".vcf")
try data.write(to: tmp)
Task { @MainActor in
await self.handleFileURL(content: content, url: tmp, index: index)
}
} else {
NSLog("[ERROR] Cannot load vcard content !\(String(describing: content))")
await self.dismissWithError(message: "Cannot load vCard content \(String(describing: content))")
}
} catch {
NSLog("[ERROR] handleVCard exception: \(error.localizedDescription)")
await self.dismissWithError(message: "vCard error: \(error.localizedDescription)")
}
}
}

private func handleText(content: NSExtensionItem, attachment: NSItemProvider, index: Int) async {
Task.detached {
if let item = try! await attachment.loadItem(forTypeIdentifier: self.textContentType)
Expand Down Expand Up @@ -727,6 +757,7 @@ internal let mimeTypes = [
"asf": "video/x-ms-asf",
"wmv": "video/x-ms-wmv",
"avi": "video/x-msvideo",
"vcf": "text/vcard",
]

extension URL {
Expand Down
58 changes: 58 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,26 @@
xcode "^3.0.1"
xml2js "0.6.0"

"@expo/config-plugins@~54.0.2":
version "54.0.2"
resolved "https://registry.yarnpkg.com/@expo/config-plugins/-/config-plugins-54.0.2.tgz#4760319898e1a55c0d039adaee1360cff147d454"
integrity sha512-jD4qxFcURQUVsUFGMcbo63a/AnviK8WUGard+yrdQE3ZrB/aurn68SlApjirQQLEizhjI5Ar2ufqflOBlNpyPg==
dependencies:
"@expo/config-types" "^54.0.8"
"@expo/json-file" "~10.0.7"
"@expo/plist" "^0.4.7"
"@expo/sdk-runtime-versions" "^1.0.0"
chalk "^4.1.2"
debug "^4.3.5"
getenv "^2.0.0"
glob "^10.4.2"
resolve-from "^5.0.0"
semver "^7.5.4"
slash "^3.0.0"
slugify "^1.6.6"
xcode "^3.0.1"
xml2js "0.6.0"

"@expo/config-types@^53.0.5":
version "53.0.5"
resolved "https://registry.yarnpkg.com/@expo/config-types/-/config-types-53.0.5.tgz#bba7e0712c2c5b1d8963348d68ea96339f858db4"
Expand Down Expand Up @@ -1201,6 +1221,25 @@
slugify "^1.3.4"
sucrase "3.35.0"

"@expo/config@~12.0.10":
version "12.0.10"
resolved "https://registry.yarnpkg.com/@expo/config/-/config-12.0.10.tgz#18acc0a2d5994dc167d1d4faca3e939de2bb95de"
integrity sha512-lJMof5Nqakq1DxGYlghYB/ogSBjmv4Fxn1ovyDmcjlRsQdFCXgu06gEUogkhPtc9wBt9WlTTfqENln5HHyLW6w==
dependencies:
"@babel/code-frame" "~7.10.4"
"@expo/config-plugins" "~54.0.2"
"@expo/config-types" "^54.0.8"
"@expo/json-file" "^10.0.7"
deepmerge "^4.3.1"
getenv "^2.0.0"
glob "^10.4.2"
require-from-string "^2.0.2"
resolve-from "^5.0.0"
resolve-workspace-root "^2.0.0"
semver "^7.6.0"
slugify "^1.3.4"
sucrase "3.35.0"

"@expo/config@~12.0.9":
version "12.0.9"
resolved "https://registry.yarnpkg.com/@expo/config/-/config-12.0.9.tgz#07e1ddb3c9227031e9e9322e41797ad36197a1c3"
Expand Down Expand Up @@ -1231,6 +1270,17 @@
dotenv-expand "~11.0.6"
getenv "^2.0.0"

"@expo/env@~2.0.7":
version "2.0.7"
resolved "https://registry.yarnpkg.com/@expo/env/-/env-2.0.7.tgz#7b30d3ef9f262c131ac01d8e539e37dd04b8f4bd"
integrity sha512-BNETbLEohk3HQ2LxwwezpG8pq+h7Fs7/vAMP3eAtFT1BCpprLYoBBFZH7gW4aqGfqOcVP4Lc91j014verrYNGg==
dependencies:
chalk "^4.0.0"
debug "^4.3.4"
dotenv "~16.4.5"
dotenv-expand "~11.0.6"
getenv "^2.0.0"

"@expo/json-file@^10.0.7", "@expo/json-file@~10.0.7":
version "10.0.7"
resolved "https://registry.yarnpkg.com/@expo/json-file/-/json-file-10.0.7.tgz#e4f58fdc03fc62f13610eeafe086d84e6e44fe01"
Expand Down Expand Up @@ -4045,6 +4095,14 @@ expo-constants@~17.1.7:
"@expo/config" "~11.0.12"
"@expo/env" "~1.0.7"

expo-constants@~18.0.8:
version "18.0.10"
resolved "https://registry.yarnpkg.com/expo-constants/-/expo-constants-18.0.10.tgz#92d4490d51193fc94bd40590453ce9cab4faf6fb"
integrity sha512-Rhtv+X974k0Cahmvx6p7ER5+pNhBC0XbP1lRviL2J1Xl4sT2FBaIuIxF/0I0CbhOsySf0ksqc5caFweAy9Ewiw==
dependencies:
"@expo/config" "~12.0.10"
"@expo/env" "~2.0.7"

expo-linking@~7.1.7:
version "7.1.7"
resolved "https://registry.yarnpkg.com/expo-linking/-/expo-linking-7.1.7.tgz#8e41ef1ca5d1190dfc01b7f4dbc4c3993bdc4523"
Expand Down