I get the following warning with the above line [Unhandled promise rejection: Error: No Activity found to handle Intent { act=android.intent.action.SEND dat=com.instagram.android (has extras) }]
Also, through Linking, I can open the Instagram app by calling (But not share image)
IntentLauncherAndroid is missing the ability to call setType and setPackage.
On Android the API would look like this:
Intent intent = getPackageManager().getLaunchIntentForPackage("com.instagram.android");
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setPackage("com.instagram.android");
try {
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(MediaStore.Images.Media.insertImage(getContentResolver(), imagePath, "I am Happy", "Share happy !")));
} catch (FileNotFoundException e) {
}
shareIntent.setType("image/jpeg");
startActivity(shareIntent);
If you want to open a PR I can work through it with you. Not sure the best solution for this given that ReactNative.Share & ReactNative.Linking both drop the ball on this.
It would be nice to unify the process across platforms rather than to use IntentLauncherAndroid .
Shall I submit a PR for this? Also if the PR gets merged - do we have to wait till the next release comes out? Or can we use the master branch for our builds?