KasemJaffer / receive_sharing_intent

A Flutter plugin that enables flutter apps to receive sharing photos, text and url from other apps.
Apache License 2.0
325 stars 375 forks source link

Cannot receive media file or content text on IOS simulator device #176

Open ThuyenPVT opened 3 years ago

ThuyenPVT commented 3 years ago

Thank you your amazing plugin and i love it ! But i got some problem related to receive sharing data on simulator IOS device ! I just got the ShareMedia://dataUrl=ShareKey#media. I looking for anyone have same problem with me and show me some suggestion to solve this problem

FabianVarela commented 3 years ago

@ThuyenPVT I inspected the code in master and I see the SharedExtension iOS class in example and concat the bundleId, just like:

let url = URL(string: "ShareMedia-\(hostAppBundleIdentifier)://dataUrl=\(sharedKey)#\(type)")

And the info.plist file, set in CFBundleURLSchemes key set the below:

<string>ShareMedia-$(PRODUCT_BUNDLE_IDENTIFIER)</string>
NikhilMJain commented 3 years ago

Share complete info.plist @FabianVarela

FabianVarela commented 3 years ago

@NikhilMJain I can't share the complete Info.plist file. But the section that I've shared you must set on this section like this:

<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>ShareMedia-$(PRODUCT_BUNDLE_IDENTIFIER)</string>
            </array>
        </dict>
    </array>

The Info.plist file in your Share extensions, must be similar to the example package and that's it.