Hello.
I use fabric for Twitter Share function in my Unity game (Android).
I follow all instructions, but I can`t authorize in twitter. But i have my app on dashboard in my fabric account!
Full code:
using UnityEngine;
using Fabric.Twitter;
using System.IO;
using System.Collections;
public class TwitterManager : MonoBehaviour
{
public void Awake()
{
Twitter.Init();
// Fabric.Initialize();
}
public void Login()
{
TwitterSession session = Twitter.Session;
if (session == null)
{
Twitter.LogIn(LoginComplete, LoginFailure);
}
else
{
LoginComplete(session);
}
}
void LoginComplete(TwitterSession session)
{
// Start composer or request email
Debug.Log("LoginComplete!!!");
string path = Path.GetFullPath("Art/art.jpg");
startComposer(session, path);//"http://i.imgur.com/U0l4sn6.jpg"
}
public void startComposer(TwitterSession session, string imageUri)
{
Card card = new AppCardBuilder()
.ImageUri(imageUri)
.GooglePlayId("com.mycompany.mygame");
//.IPhoneId("123456789")
//.IPadId("123456789");
Twitter.Compose(session, card);
}
void LoginFailure(ApiError error)
{
Debug.Log("code=" + error.code + " msg=" + error.message);
}
}
Thanks!