Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

error in sharing to story Instagram #3

Closed
arefhosseini opened this issue Oct 21, 2019 · 3 comments
Closed

error in sharing to story Instagram #3

arefhosseini opened this issue Oct 21, 2019 · 3 comments

Comments

@arefhosseini
Copy link

Due to the Sharing to Stories in Instagram, I got this error:

PlatformException(Error, android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.instagram.share.ADD_TO_STORY typ=png flg=0x1 (has extras) }, null)

Here is my example code:

Intent()
          ..setAction("com.instagram.share.ADD_TO_STORY")
          ..setType("png")
          ..setData(Uri.parse(exportedFile.path))
          ..addFlag(1) // FLAG_GRANT_READ_URI_PERMISSION = 1
          ..putExtra("content_url", "http://vocofit.ir")
          ..startActivity().catchError((e) => print(e));

Is there any problem in my code?

@itzmeanjan
Copy link
Owner

Hello @arefhosseini , I think there's some error with INTENT_ACTION and TYPE can't just be png. Let me do some digging, I'll inform you soon :)

@itzmeanjan
Copy link
Owner

Hei @arefhosseini , consider running your code, while setting .setType("image/png"). Let me know, how does it behave ?

@arefhosseini
Copy link
Author

Hey there, I tried so much but I think should set another config in manifest or something.
I just use this library and everything works fine.
Much an appreciate for helping.

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

No branches or pull requests

2 participants