Source:
protected void openIntentChooser(ReadableMap options) throws ActivityNotFoundException { if (this.options.hasKey("forceDialog") && this.options.getBoolean("forceDialog")) { Activity activity = this.reactContext.getCurrentActivity(); if (activity == null) { TargetChosenReceiver.sendCallback(false, "Something went wrong"); return; } String socialType = options.getString("social"); if (socialType.equals("instagramstories")) { String method = options.getString("method"); if (method.equals("shareStickerImage") || method.equals("shareBackgroundAndStickerImage")) { activity.grantUriPermission("com.instagram.android", this.stickerAsset.getURI(), Intent.FLAG_GRANT_READ_URI_PERMISSION); } } if (TargetChosenReceiver.isSupported()) { IntentSender sender = TargetChosenReceiver.getSharingSenderIntent(this.reactContext); Intent chooser = Intent.createChooser(this.getIntent(), this.chooserTitle, sender); chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); } else { Intent chooser = Intent.createChooser(this.getIntent(), this.chooserTitle); chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); TargetChosenReceiver.sendCallback(true, true, "OK"); } } else { this.getIntent().setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); this.reactContext.startActivity(this.getIntent()); TargetChosenReceiver.sendCallback(true, true, this.getIntent().getPackage()); } }

Target:
protected void openIntentChooser(ReadableMap options) throws ActivityNotFoundException { if (this.options.hasKey("forceDialog") && this.options.getBoolean("forceDialog")) { Activity activity = this.reactContext.getCurrentActivity(); if (activity == null) { TargetChosenReceiver.sendCallback(false, "Something went wrong"); return; } if (options != null) { if (ShareIntent.hasValidKey("social", options)) { String socialType = options.getString("social"); if (socialType.equals("instagramstories")) { if (ShareIntent.hasValidKey("method", options)) { String method = options.getString("method"); if (method.equals("shareStickerImage") || method.equals("shareBackgroundAndStickerImage")) { activity.grantUriPermission("com.instagram.android", this.stickerAsset.getURI(), Intent.FLAG_GRANT_READ_URI_PERMISSION); } } else { throw new java.lang.IllegalArgumentException("instagram share mode is empty"); } } } else { throw new java.lang.IllegalArgumentException("social is empty"); } } if (TargetChosenReceiver.isSupported()) { IntentSender sender = TargetChosenReceiver.getSharingSenderIntent(this.reactContext); Intent chooser = Intent.createChooser(this.getIntent(), this.chooserTitle, sender); chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); } else { Intent chooser = Intent.createChooser(this.getIntent(), this.chooserTitle); chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); TargetChosenReceiver.sendCallback(true, true, "OK"); } } else { this.getIntent().setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); this.reactContext.startActivity(this.getIntent()); TargetChosenReceiver.sendCallback(true, true, this.getIntent().getPackage()); } }