-1

My code is not working from the latest Snapchat update. I've just opened Snapchat with an image like this.

final Intent intent = new Intent(Intent.ACTION_SEND);
intent.setPackage(ShareConstants.SNAPCHAT_PACKAGE_NAME);
final File file = new File(shareItem.getPath());
final Uri photoURI = FileProvider.getUriForFile(activity.get(),ShareConstants.FILE_PROVIDER, file);
intent.putExtra(Intent.EXTRA_STREAM, photoURI);
intent.setTypeAndNormalize(ShareConstants.MIME_TYPE_IMAGE);
startActivity(intent);

It just opens Snapchat camera. Thank you.

1 Answers1

0

Let try this dude,

Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.setType("image/jpeg");
intent.setPackage(ShareConstants.SNAPCHAT_PACKAGE_NAME);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra(Intent.EXTRA_STREAM, photoURI);
startActivity(Intent.createChooser(intent,"Share SnapChat"));
Gobu CSG
  • 653
  • 5
  • 7