Default Sharing Dialog

As an alternative, you can show a standard android sharing dialogue box and let user decide where to post by his own. The sharing dialogue will look similar to the one on a screenshot below:

Text Share Example

AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share");

Text & Image Share Example

Texture2D image = GetImage();
AndroidSocialGate.StartShareIntent("Hello Share Intent", "Sharing Hello wolrd image", image);

We can provide a package name filter to specify an exact app package we want to use for sharing or narrow down suggested apps range. Using package name filter is showed below:

Texture2D image = GetImage();
string packageNamePattern = "mail" //all installed mail apps will be sugested
AndroidSocialGate.StartShareIntent("Hello", "Sharing Hello wolrd image", image, packageNamePattern);

The  packageNamePattern variable is used to define the app which will be used for the sharing. So, for example, if you are using the pattern like  "facebook.katana", only official facebook app will be used for sharing. And if you  use something like "face", most of the 3-rd party apps for facebook will match this pattern and, in this case those apps will be also offered to user for sharing. 

If Plugin does not find installed application on the device to match provided pattern,  a default sharing dialog will be used.

Note: To share the image using Intent.ACTION_SEND image should be saved on a disc and we will provide image URI as Intent.EXTRA_STREAM. We are saving an external storage using Images.Media.insertImage. If an external storage isn't available,  plugin will use internal storage and use FileProvider  for sending content to another app. But not all social applications support this method. So, there is a fail possibility with the devices which don't have an external storage support.


The full API use example can be found at the SocialSharing example scene.