expo-mail-composer-fixed
v14.1.6
Published
Provides an API to compose mails using OS specific UI - Fixed duplicate plist entries issue
Maintainers
Readme
@sunwoo/expo-mail-composer-fixed
A fixed version of expo-mail-composer that resolves duplicate plist entries during expo prebuild.
Problem Solved
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.
Fix Applied
This fork fixes the issue by filtering out existing mail client URL schemes before adding them fresh during each prebuild run. The plugin now:
- Gets existing schemes from
LSApplicationQueriesSchemes - Filters out any previously added mail client URLs
- Adds the complete set of mail client URLs fresh
- Prevents duplicates using a Set
Installation
npm install @sunwoo/expo-mail-composer-fixedor
yarn add @sunwoo/expo-mail-composer-fixedUsage
Use exactly the same as the original expo-mail-composer:
import * as MailComposer from '@sunwoo/expo-mail-composer-fixed';
// ... rest of your code remains the sameWhat Changed
The fix was applied to the config plugin in plugin/src/withMailComposer.ts:
// 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.
License
MIT - Same as original expo-mail-composer
Original Package
This is a fork of expo-mail-composer version 14.1.4 with the prebuild fix applied.
