react-native-share-menu
react-native-share-menu copied to clipboard
Can not share JSON, CSV ... these format file [iOS]
Hi friend, Thanks for the amazing library. I cloned the example code and successfully to share the system library image and video. When I tried to open system Files Application and share any other format files, i found i can shared PDF format file, but when i want to share .json, .txt or .csv file, i clicked send button but App was not launched and nothing happen. Is there any friends please help me to take a look? Thanks.
Share PDF format file: Success
https://user-images.githubusercontent.com/22705471/115984127-088e6200-a5d8-11eb-86c8-f8234f717f68.MP4
Share JSON, CSV file: Failed
https://user-images.githubusercontent.com/22705471/115984138-1d6af580-a5d8-11eb-8290-b55a55ee8c99.MP4
Same issue for me
For me, the share extension wasn't showing up in the share menu when sharing pdf/csv/json files. I changed the activation rules and it's working now.
<key>NSExtensionActivationRule</key>
<string>SUBQUERY (
extensionItems,
$extensionItem,
SUBQUERY (
$extensionItem.attachments,
$attachment,
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image" ||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.data" ||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.content" ||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.compuserve.gif"
).@count == $extensionItem.attachments.@count
).@count == 1
</string>
It's not getting redirected when a csv file is used. Any help?
Found the solution . To make CSV work Change the isText condition to also have the condition which they have for files in file ShareViewController.swift
for provider in attachments {
if provider.isText {
self.storeFile(withProvider: provider, semaphore)
} else if provider.isURL {
self.storeUrl(withProvider: provider, semaphore)
} else {
self.storeFile(withProvider: provider, semaphore)
}