sdkBox Native Share problem

Hi, I’m trying native share feature on Android, and first time i used it shown the window to select app to share, shared successfully with WhatsApp but now when I call the nativeShare function it goes directly to WhatsApp instead of asking were I what to share. Even reinstalling the app does not help.

Thanks.

Ok, realyzed there is a “use as default app” checkbox so cleared my mobile preferences and now i can choose again. Most apps do not show this checkbox.

Is there any way to hide the “use as default app” checkbox in the Native Share in Android?

Guess could be fixed with this:


But we do not have access to the relevant java files.

Also if i use share instead of nativeSahre. With Platform_Email i get the desired app chooser but with the wrong title “share with email” and of course does not make much sense so i don’t know if its safe to use. With Platform_Native calling share just does nothing :frowning:

Also tried to delete shared preferences but i always get an empty list.

Any help?

We’ll take a look at this and get back to you.

Thanks, currently i created a java function that works fine in Android, iOS still not tested.

In my opinion simple native share is better than Facebook or Twitter. You can directly share images without any configuration in any social network provided the user has the app installed.

This is my java function:

public static void alertJNI() {
    Intent shareIntent = new Intent(Intent.ACTION_SEND);
    shareIntent.setAction(Intent.ACTION_SEND);
    shareIntent.setType("image/png");
    shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Te Subject" );
    shareIntent.putExtra(Intent.EXTRA_TEXT, "your text here );
    String fileUri = "file://" + Environment.getExternalStorageDirectory() +  "/filename.png";
    shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(fileUri));
    Cocos2dxActivity.getContext().startActivity(Intent.createChooser(shareIntent, "Share with ..."));
}
1 Like

thanks for your advice, please wait next release and try.

1 Like