Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working #2

Closed
SergiiMytakii opened this issue May 22, 2022 · 23 comments
Closed

Not working #2

SergiiMytakii opened this issue May 22, 2022 · 23 comments

Comments

@SergiiMytakii
Copy link

I followed all steps, after hitting 'share' extension redirects to the containing app, but it does not receive any data

@Shawn-sudo
Copy link

Shawn-sudo commented May 24, 2022

For me, the OS seemed to reject opening the main app in a share extension (iOS). Probably mine is another issue.

@JoshJuncker
Copy link
Collaborator

JoshJuncker commented May 29, 2022

@SergiiMytakii What platform are you running on? And are you using actual device or simulator? Are you not getting any data on initial load from the getInitialSharedMedia? Or are you not getting anything from listening to the stream when your app is already open? If you download the repo and run the example, does the example work for you?
Anyways, just more information would be helpful.

@JoshJuncker
Copy link
Collaborator

JoshJuncker commented May 29, 2022

@Shawn-sudo Did you make sure to follow the first step for iOS implementation, adding to the info.plist?
It registers the deep link that is used by the plugin to open the app on redirect.
Anyways, if that doesn't work, please submit that is a separate issue. And check out the example to see if it runs for you.

<!-- The 'NSUserActivityTypes' key is only needed if you plan to use the recordSentMessage API allowing for conversations to show up as direct share suggestions -->
<key>NSUserActivityTypes</key>
<array>
    <string>INSendMessageIntent</string>
</array>
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>ShareMedia-$(PRODUCT_BUNDLE_IDENTIFIER)</string>
        </array>
    </dict>
    <dict/>
</array>

<key>NSPhotoLibraryUsageDescription</key>
<string>Photos can be shared to and used in this app</string>
<!-- Add for share_handler end -->```

@Phmichau
Copy link

Phmichau commented Jun 2, 2022

Work great now. thank you

@dimitchik
Copy link

Same issue, iOS, reproduces both on simulator and real device, both getInitialSharedMedia and the stream don't receive any data. Example from the repo doesn't work either.

@JoshJuncker
Copy link
Collaborator

@dimitchik On a real iOS device, what are you trying to share? Can you try sharing different things? Like a website from Safari, or an image from Photos. Can you also run a flutter doctor so I can see the versions you are using?

@dimitchik
Copy link

Got the example project running after editing podfile (didn't notice it's in .gitignore).
The issue seems to be with the xcode setup after all, I'll update here after i find out more.

@dimitchik
Copy link

OK, so I finally got it working! What fixed the problem for me was adding share_handler_ios to pubspec.yaml, so it has both share_handler and share_handler_ios. Can't reproduce this issue on other projects though, so not sure what even causes it.

@JoshJuncker
Copy link
Collaborator

@dimitchik Adding share_handler_ios explicit seems like a weird fix as it is required by the share_handler pub spec. But either way, I'm glad you got it working!

@BrianMwas
Copy link

I tried everything even the example app but it did not run in my physical device. Am running an Oppo

@BrianMwas
Copy link

Not sure what am missing

@JoshJuncker
Copy link
Collaborator

@BrianMwas What is an "Oppo"? And what physical device? Also what flutter version?

@BrianMwas
Copy link

Oppo is a phone brand just like Samsung am using Flutter v2.10.5. So it works with every other export except WhatsApp which was what I am working on

@JoshJuncker
Copy link
Collaborator

@BrianMwas Just to clarify, sharing to your app is working when shared from other apps, like photos or drive, but not from WhatsApp?

@BrianMwas
Copy link

Yes

@BrianMwas
Copy link

Any update @JoshJuncker

@JoshJuncker
Copy link
Collaborator

@BrianMwas Sorry. I haven't had time recently and I don't use WhatsApp. I might be able to look into it today though.

@ultimate-tester
Copy link

ultimate-tester commented Aug 7, 2022

Same issue on iOS here, trying to share a contact (comes in the form of a vcard). App opens fine, but stream and initial function do not return anything..

Trying to share an image does give me the path of the image so that works! I am not after images though :)

More testing:

  • Plain text: no data
  • Images: path to image is received
  • Contact/vcards: no data
  • Note: no data
  • URL: no data

@JoshJuncker
Copy link
Collaborator

@ultimate-tester Are you sharing all of these things from WhatsApp? If not, what apps are you sharing them from?

@ultimate-tester
Copy link

@ultimate-tester Are you sharing all of these things from WhatsApp? If not, what apps are you sharing them from?

Thanks for the quick response. I’m sharing from the native app on iOS for the corresponding categories:

Contacts app, Photos app, Notes app, Safari.
I think I tested the plain text from Safari as well, simply selecting some text and hitting share.

Having just tested WhatsApp (hold a message, forward, share), that also doesn’t work. Seems like nothing comes in at the flutter side.

@JoshJuncker
Copy link
Collaborator

@ultimate-tester Interesting. I can't reproduce the notes (plain text) and safari (url) issue. Those share just fine for me on iOS. I'd make sure to follow the instructions carefully, or clone the repo and try the example project.
However, sharing a contact (v-card) didn't work for me, so I'll have to look into that.

@giorgio79
Copy link

Just installed the iOS example app on an a simulator: iOS 11 13.7, but the app does not appear in share targets when highlighting text in Safari and trying to share it to the app... Any tips please? :)

@giorgio79
Copy link

PS Just tried this one and the example works out of the box on iOS Simulator 11 13.7. Hopefully we can lift some code from there to this app ;) https://github.com/JaimilPatel/ReceiveSharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants