【发布时间】:2021-11-19 09:19:45
【问题描述】:
实际上,我使用此选项分享到 Instagram 故事,允许分享到每个 Instagram 选项,但现在我在要分享到 Instagram 故事时发现了错误。当我选择该选项时,会出现黑屏,没有我之前收费的图像,但只有故事、Feed 和 Direct 完美运行才会出现这种情况。
// Create the new Intent using the 'Send' action.
Intent share = new Intent(Intent.ActionSend);
// Add the URI to the Intent.
share.PutExtra(Intent.ExtraStream, Uri.Parse("file://" + mediaPath));
// Set the MIME type
share.SetType("image/jepg");
share.SetPackage("com.instagram.android");
Xamarin.Forms.Forms.Context.StartActivity(Intent.CreateChooser(share, "Share image"));
result = true;
按照文档:
https://developers.facebook.com/docs/instagram/sharing-to-stories
我可以打开 Instagram 快拍编辑器,但看不到照片,它继续黑...
Intent share = new Intent("com.instagram.share.ADD_TO_STORY");
Uri backgroundAssetUri = Uri.Parse("file://" + ruta);
share.SetDataAndType(backgroundAssetUri, "image/jepg");
share.SetFlags(ActivityFlags.GrantReadUriPermission);
Xamarin.Forms.Forms.Context.StartActivity(Intent.CreateChooser(share, "Share image"));
有人可以帮我吗?
【问题讨论】:
-
如果您使用 Xamarin.Forms,为什么不使用 Xamarin.Essentials.Share ?
-
因为我只想将图像分享到某个目标应用程序 (Instagram),并且我需要为 Android 正确实现分享,因为 iOS 完美运行@JuanSturla
-
很多人报告了这种行为,说这是 Instagram 的问题。您是否尝试过其他 android 版本或 instagram 版本?
-
实际上我正在使用 Android 10 和最后一次 Instagram 更新@JuanSturla 进行所有测试
标签: android image xamarin.forms instagram share