Social Sharing

Here is how you can share simple text:

With Twitter:

OSXSocialManager.instance.TwitterPost("Twitter posting test");

With Facebook:

OSXSocialManager.instance.FacebookPost("Facebook posting test");

Share and let the user choose which application to use for sharing:

OSXSocialManager.instance.ShareMedia("Some text to share");


You can also share texture, by adding the second parameter to this function. But make sure your texture is marked as readable.

Here are the examples with the texture parameter:

OSXSocialManager.instance.FacebookPost("Hello world", textureForPost);
OSXSocialManager.instance.TwitterPost("Hello world", textureForPost);
OSXSocialManager.instance.ShareMedia("Some text to share", tex);


Use sharing API for sending e-mail:

OSXSocialManager.instance.SendMail("Mail Subject", "Mail Body", ",", textureForPost);


You can always get the posting result by subscribing on following Actions:

public Action<ISN_Result> OnFacebookPostResult;
public Action<ISN_Result> OnTwitterPostResult;
public Action<ISN_Result> OnMailResult;

If the posting is failed, object error of a result will contain the error code and description.

The code snippet below shows how to retrieve the posting result:

OSXSocialManager.instance.OnFacebookPostResult+= OnFacebookResult;
OSXSocialManager.instance.FacebookPost("Hello world", textureForPost);

void OnFacebookResult (ISN_Result result) {
	if(result.IsSucceeded) {
		OSXMessage.Create("Posting example", "Posting success");
	} else {
		OSXMessage.Create("Error - " + result.error.code, result.error.description);


Note: You can also use HTML format for your e-mail. See the example bellow:

OSXSocialManager.instance.SendMail("Mail Subject", "Mail Body  <strong> text html </strong> ", ",", textureForPost);


More examples can be found under the SocialPostingExample Example Scene