Provides an API to compose mails using OS specific UI - Fixed duplicate plist entries issue
npm install expo-mail-composer-fixedA fixed version of expo-mail-composer that resolves duplicate plist entries during expo prebuild.
The original expo-mail-composer package had an issue where running expo prebuild multiple times would result in duplicate LSApplicationQueriesSchemes entries in the iOS Info.plist file. This caused prebuild errors on subsequent runs.
This fork fixes the issue by filtering out existing mail client URL schemes before adding them fresh during each prebuild run. The plugin now:
1. Gets existing schemes from LSApplicationQueriesSchemes
2. Filters out any previously added mail client URLs
3. Adds the complete set of mail client URLs fresh
4. Prevents duplicates using a Set
``bash`
npm install @sunwoo/expo-mail-composer-fixed
or
`bash`
yarn add @sunwoo/expo-mail-composer-fixed
Use exactly the same as the original expo-mail-composer:
`javascript
import * as MailComposer from '@sunwoo/expo-mail-composer-fixed';
// ... rest of your code remains the same
`
The fix was applied to the config plugin in plugin/src/withMailComposer.ts:
`typescript``
// Before adding mail client URLs, filter out any existing ones
const filteredExistingSchemes = existingSchemes.filter(scheme => !mailClientURLs.includes(scheme));
const newSchemes = [...new Set([...filteredExistingSchemes, ...mailClientURLs])];
This ensures clean prebuild runs every time, without duplicate plist entries.
MIT - Same as original expo-mail-composer
This is a fork of expo-mail-composer version 14.1.4 with the prebuild fix applied.