Skip to content

feat: add vCard file sharing support in iOS share extension#194

Merged
achorein merged 5 commits intoachorein:mainfrom
Kasendwa:ft-add-contacts-sharing
Nov 6, 2025
Merged

feat: add vCard file sharing support in iOS share extension#194
achorein merged 5 commits intoachorein:mainfrom
Kasendwa:ft-add-contacts-sharing

Conversation

@Kasendwa
Copy link
Contributor

feat: add vCard file sharing support in iOS share extension

Description

Adds native vCard (contact) file sharing support to the iOS share extension, allowing users to share contact files (.vcf) from other apps directly into Expo apps.

Changes

  • Added vcardContentType constant for "public.vcard" MIME type
  • Implemented handleVCard function with comprehensive error handling
  • Added vCard detection logic in the main content processing flow
  • Support for both URL and Data attachment types
  • Automatic .vcf file extension assignment for proper MIME type resolution
  • Enhanced logging for debugging vCard processing

Technical Details

The implementation handles vCard data as both URL references and raw Data objects. When processing Data objects, it creates temporary .vcf files to ensure proper MIME type resolution. Uses Task.detached for async file operations off the main thread.

Testing

To test vCard sharing functionality, set your iosActivationRules to the following :

`SUBQUERY(
    extensionItems,
    $item,
    SUBQUERY(
	    $item.attachments,
	    $attachment,
	    (
	    ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url" ||
	    ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image" ||
	    ANY $attachment.registeredTypeIdentifiers == "public.vcard" ||
	    ANY $attachment.registeredTypeIdentifiers == "public.text" ||
	    ANY $attachment.registeredTypeIdentifiers == "public.data" ||
	    ANY $attachment.registeredTypeIdentifiers == "com.adobe.pdf"
	    )
    ).@count == 1
  ).@count == 1`

@achorein
Copy link
Owner

achorein commented Nov 6, 2025

LGTM, thanks

@achorein achorein merged commit be624ef into achorein:main Nov 6, 2025
4 checks passed
@Kasendwa Kasendwa deleted the ft-add-contacts-sharing branch November 7, 2025 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants