receive_sharing_intent icon indicating copy to clipboard operation
receive_sharing_intent copied to clipboard

iOS example app does not seem to work

Open basvdijk opened this issue 1 year ago β€’ 10 comments

When I run the app from the example folder on https://github.com/KasemJaffer/receive_sharing_intent/tree/master/example on iOS it does not seem to work.

When sharing an image:

  • You see the app in the list image
  • Then for a split second you see this window pop up image
  • Then nothing happens

I tested this on an iPhone 15 Pro Max emulator running iOS 17.4

basvdijk avatar May 07 '24 15:05 basvdijk

me to 😒 I tested this on an iPhone 14 Pro actual machine

wanwanland avatar May 08 '24 02:05 wanwanland

me to 😒 I checked again and again to see what I might have done wrong. Has anyone found a solution?

olerhan avatar May 24 '24 00:05 olerhan

My biggest concern at the moment is reliability of this feature / package. It has been 2 weeks without reply to this issue. I am holding back to use this package for now. If I use this in production and it breaks, I do not want to risk to have a broken feature for weeks.

basvdijk avatar May 24 '24 05:05 basvdijk

I managed to get it to work. While the package publisher could have provided clearer instructions, it's important to understand some key points when adding packages to your application. After trying many forked versions of this package and examining the package codes, I've gained full experience with it. The issue is actually quite simple. Here are the key steps:

Pay attention to the Info.plist files. Insert the required codes correctly. Provide the host and extension IDs in the correct format. After filling in the ShareViewController content, be sure to run pod install in the iOS directory before running the application. Follow the cycle described by the publisher carefully. If you are not using custom IDs, fill them in manually in the Info.plist table. The original package works fine and is more compact than other packages. It also has a supportive community.

I hope this helps others who are facing similar issues.

olerhan avatar May 25 '24 02:05 olerhan

for me what made it work is adding the custom IDs manually for both Runner and Sharing Extension under Build Settings, what @olerhan suggested above. Screenshot 2024-06-03 at 16 31 18

tamara-jovanoska avatar Jun 03 '24 15:06 tamara-jovanoska

Same here. I cloned the example and it doesn't work for iOS either. The app doesn't receive the shared files. Confirmed on iOS 17.5 simulator.

Guscccc avatar Jul 19 '24 11:07 Guscccc

@tamara-jovanoska I solved it the same way (tested on physical iOS 17.5.1). @olerhan and @tamara-jovanoska, your comments could helped clarify instructions from point 6 from the publisher.

IndyNiels avatar Aug 06 '24 07:08 IndyNiels

I think the issue is not caused by the configuration, but by this:

  • #294

bigzhu avatar Aug 19 '24 06:08 bigzhu

For me everything still works fine. Everyone just needs to be more careful about using the package. This issue (296 or 294) is not a real issue…

olerhan avatar Aug 19 '24 07:08 olerhan

I managed to get it to work. While the package publisher could have provided clearer instructions, it's important to understand some key points when adding packages to your application. After trying many forked versions of this package and examining the package codes, I've gained full experience with it. The issue is actually quite simple. Here are the key steps:

Pay attention to the Info.plist files. Insert the required codes correctly. Provide the host and extension IDs in the correct format. After filling in the ShareViewController content, be sure to run pod install in the iOS directory before running the application. Follow the cycle described by the publisher carefully. If you are not using custom IDs, fill them in manually in the Info.plist table. The original package works fine and is more compact than other packages. It also has a supportive community.

I hope this helps others who are facing similar issues.

@olerhan You’re absolutely right β€” I’ve been facing image sharing intent issues for several days as well.

In my case, I’m using multiple flavors (development & production) in my Flutter app, and most of the problems were due to native misconfigurations. I spent almost 2–3 weeks debugging, but I finally figured out the full setup:

What caused the issue

  • Share Extension and App Group were not configured correctly per flavor.
  • CUSTOM_GROUP_ID was not properly assigned for each flavor in Build Settings.
  • In Xcode β†’ Runner β†’ Info β†’ Configurations, I had selected the wrong flavor for the execution target.

Final Fix

  • Created separate Share Extension bundle identifier + App Group IDs for each flavor.
  • Ensured Info.plist values were filled explicitly for each build.
  • Set CUSTOM_GROUP_ID correctly in Build Phases for both Development and Production.
  • Re-ran pod install every time after making changes.

βœ… Now image sharing is working properly on both Android and iOS.


One Remaining Question

Right now, when I share an image (from Gallery or using a quick screenshot on iOS), it shows an intermediate popup before redirecting to my app.

However, I noticed that some apps (like Discord) redirect directly into their app without showing that popup UI.

Is there a way to achieve instant redirect bypassing the popup UI entirely in iOS Share Extensions?

Would appreciate any guidance if you have insights on this approach.


this is my ShareViewController.swift code

import receive_sharing_intent

class ShareViewController: RSIShareViewController {
    
    // Automatically redirect to main app without showing any UI
    override func shouldAutoRedirect() -> Bool {
        return true  // Enable automatic redirect
    }
    
}

this is my current working app video

https://github.com/user-attachments/assets/c487f3e5-2106-4519-b398-3efb6da8f625

https://github.com/user-attachments/assets/1ea247d3-e660-41fb-820f-81879f118a81


Additional Observation

When using the iOS Share Extension to share an image from a freshly taken screenshot, the app does not display the selected image. Instead, only the keyboard opens with no preview. The shared media is not passed correctly into the app on real devices.

This happens because receive_sharing_intent uses a fallback mechanism β€” it creates a temporary image file (TempImage.png) inside the App Group container when iOS provides only an in-memory UIImage (not a file URL). However, on real devices, the shared file is not accessible to the main app due to App Group misconfiguration or sandboxing, even though it works fine on the simulator.


πŸ”— Related Discussions (React Native)

React Native discussion β€” similar issue solved natively πŸ‘‰ https://github.com/achorein/expo-share-intent-demo/issues/28 πŸ‘‰ https://github.com/ajith-ab/react-native-receive-sharing-intent/issues/56

If anyone has managed to achieve instant redirect without showing the intermediate share popup in Flutter (not React Native), please share your insights here

KhuntJenish avatar Oct 17 '25 10:10 KhuntJenish