From f16b571ba4c4b5c3278e277d49e6caedd062efc4 Mon Sep 17 00:00:00 2001 From: Mateusz Wit Date: Wed, 6 Aug 2025 21:19:22 +0200 Subject: [PATCH 1/2] feat(iOS): add ability to disable iOS overlay on bare share activity (#1674) --- ios/RNShare.mm | 12 ++++++++++-- src/types.ts | 2 ++ website/docs/share-open.mdx | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ios/RNShare.mm b/ios/RNShare.mm index 0c9eca36..29f8b3b8 100644 --- a/ios/RNShare.mm +++ b/ios/RNShare.mm @@ -290,10 +290,18 @@ - (NSDictionary*) getConstants { [controller presentViewController:documentPicker animated:YES completion:nil]; return; } - } - + } + UIActivityViewController *shareController = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil]; + BOOL disableOverlay = [RCTConvert BOOL:options[@"disableOverlay"]]; + + if (@available(iOS 15.0, *)) { + if (disableOverlay == true) { + shareController.sheetPresentationController.largestUndimmedDetentIdentifier = UISheetPresentationControllerDetentIdentifierLarge; + } + } + NSString *subject = [RCTConvert NSString:options[@"subject"]]; if (subject) { [shareController setValue:subject forKey:@"subject"]; diff --git a/src/types.ts b/src/types.ts index 34cd299b..47d736c9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -109,6 +109,8 @@ export interface ShareOptions { saveToFiles?: boolean; activityItemSources?: ActivityItemSource[]; isNewTask?: boolean; + /** iOS Only */ + disableOverlay?: boolean; } export type ActivityType = diff --git a/website/docs/share-open.mdx b/website/docs/share-open.mdx index cdff3c97..ad1aa8a1 100644 --- a/website/docs/share-open.mdx +++ b/website/docs/share-open.mdx @@ -52,6 +52,7 @@ You can customize the call to `Share.open` passing the following parameters: | activityItemSources | Array[Object] | Array of activity item sources. Each items should conform to [ActivityItemSource](#activityitemsource) specification. [Example](#example-activityitemsources). | ✅ | 🚫 | ✅ | ❓ | | useInternalStorage | boolean | Store the temporary file in the internal storage cache (Android only) | ✅ | ✅ | 🚫 | 🚫 | | isNewTask | boolean | Open intent as a new task. "failOnCancel" will not work. | ✅ | ✅ | 🚫 | ❓ | +| disableOverlay | boolean | Disable dimming/dismissible overlay of share activity | ✅ | 🚫 | ✅ | ❓ | ## Sharing a base64 file format From c07effb753e48f8933b465c09b6b217855cd62a1 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 6 Aug 2025 19:20:44 +0000 Subject: [PATCH 2/2] chore(release): 12.2.0 [skip ci] # [12.2.0](https://github.com/react-native-community/react-native-share/compare/v12.1.2...v12.2.0) (2025-08-06) ### Features * **iOS:** add ability to disable iOS overlay on bare share activity ([#1674](https://github.com/react-native-community/react-native-share/issues/1674)) ([f16b571](https://github.com/react-native-community/react-native-share/commit/f16b571ba4c4b5c3278e277d49e6caedd062efc4)) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c012c23b..3c8a7721 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-native-share", "description": "Social share, sending simple data to other apps.", - "version": "12.1.2", + "version": "12.2.0", "repository": { "type": "git", "url": "git+https://github.com/react-native-community/react-native-share.git"