ajith-ab / react-native-receive-sharing-intent

A React Native plugin that enables React Native apps to receive sharing photos, videos, text, urls or any other file types from another app
MIT License
305 stars 109 forks source link

iOS share dialog #37

Open robsco opened 4 years ago

robsco commented 4 years ago

When sharing a url from iOS, either Chrome or Safari, I'm getting a share dialog open with a thumbnail, rather than launching my app directly/immediately.

On Android it opens directly into the app fine, and is picked up by code running on one of my screens (under React Navigation).

When I submit the share dialog on iOS, it does launch the app, but the code in my screen doesn't fire.

Copy & pasted every as-is from the docs, changing my hostAppBundleIdentifier.

I actually only want to share URLs currently, no need for other files.

If it make any difference, I also support deeplink and fb shares, so already had a scheme in my info.plist: `

CFBundleURLTypes
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb528385004187724</string>
        </array>
    </dict>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>ttgm</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>ttgm</string>
            <string>ShareMedia</string>
        </array>
    </dict>
</array>
<key>NSPhotoLibraryUsageDescription</key>
  <string>
    To upload photos, please allow permission to access your photo library.
  </string>

` Perhaps you could show simplified instructions for ONLY sharing a url, to see which bits are needed, and which aren't.

Coming from a ReactNative background, a screen full of Swift code is a bit daunting for most.

duylinhdang1998 commented 4 years ago

+1 I have the same problem

ateev commented 4 years ago

+1 Getting this for files shares on iOS. Any idea what could be going wrong @ajith-ab ?

duylinhdang1998 commented 4 years ago

@ateev here is the solution https://github.com/ajith-ab/react-native-receive-sharing-intent/issues/28

nschild commented 3 years ago

@ateev here is the solution #28

For a copy/paste solution: https://github.com/ajith-ab/react-native-receive-sharing-intent/issues/28#issuecomment-731725933