Tweet Sharer make easier to tweet and to receive tweet result in Unity.
- Tweet by a simple method call
- Receive tweet result by your delegate method
Put Assets/TweetSharer/Prefabs/TweetSharer.prefab
in your scene.
This gameobject is singleton and not destroyed on load another scene.
Call TweetSharer#Tweet
using UnityEngine;
using UnityTweetSharer;
public class ExampleSceneController : MonoBehaviour
{
public void OnClickTweet (string text)
{
// text: text on the new tweet
// Callback: method receives TweetResult
TweetSharer.Instance.Tweet (text, Callback);
}
void Callback (TweetResult result)
{
// TweetResult.Done: complete tweeting
// TweetResult.Cancelled: cancelled tweeting
if (result == TweetResult.Done) {
// Give some rewards.
}
Debug.Log (result.ToString ());
}
}