The reason behind this is that the default configuration of this package is designed for sharing URLs to your application.
To customize the behavior, you will need to modify/extend the NSExtensionActivationRule
in the Config.plist
file of your share extension while continuing to use the react-native-share-extension package. More information on this key can be found directly from the author and also in the Apple documentation.
You have the flexibility to rewrite the rule entirely for specific file types like PDF files (as mentioned in the Apple docs):
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<string>
{extensionItems = ({
attachments = ({
registeredTypeIdentifiers = (
"com.adobe.pdf",
"public.file-url"
);
});
})}
</string>
</dict>
A comprehensive list of keys for NSExtensionActivationRule
can be found here.