Closed mpk2 closed 7 years ago
With the current setup, sharing fails on Android N because of restrictions on use of the file protocol. Here is a description of the change.
In order to resolve the problem, I had to make changes to share in CDVInstagramPlugin.java below
share
CDVInstagramPlugin.java
private void share(String imageString, String captionString) { ... Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("image/*"); shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file)); shareIntent.putExtra(Intent.EXTRA_TEXT, captionString); shareIntent.setPackage("com.instagram.android"); this.cordova.startActivityForResult((CordovaPlugin) this, Intent.createChooser(shareIntent, "Share to"), 12345); ... }
You'll notice that this is very similar to the official Instagram example (https://www.instagram.com/developer/mobile-sharing/android-intents/).
Added PR #76
merged
With the current setup, sharing fails on Android N because of restrictions on use of the file protocol. Here is a description of the change.
In order to resolve the problem, I had to make changes to
share
inCDVInstagramPlugin.java
belowYou'll notice that this is very similar to the official Instagram example (https://www.instagram.com/developer/mobile-sharing/android-intents/).