Hello everyone,
I just updated to the new twitter kit for unity that has the new composer updates. I was under the impression that version 3 of the twitter api supported videos, see here:
I tried using the compose function and putting a link to a video on a server in the image uri field but with no luck, I get a fail message and my fail callback gets called and I get a null reference when I try to read the error message. Here is my code:
void OnTwitterLoginSuccess (TwitterSession _session) {
string[] hashtags = { "#Great", "#Best", "#Here" };
Twitter.Compose (_session, "videoLinkHere", "Simple Twitter Test", hashtags, OnTwitterComposeSuccess, OnTwitterComposeFail, OnTwitterComposeCancel);
Debug.Log (_session.userName);
Debug.Log (_session.id);
Debug.Log (_session.authToken.token);
Debug.Log (_session.authToken.secret);
}
void OnTwitterComposeSuccess (string _info) {
Debug.Log("Twitter Login Success: " + _info);
}
void OnTwitterComposeFail (ApiError _error) {
Debug.Log("Twitter Compose Error: " + _error.message); //null reference here
}
void OnTwitterComposeCancel () {
Debug.Log("Twitter Compose Cancelled!");
}
This is the error:
NullReferenceException: Object reference not set to an instance of an object
at TwitterShare.OnTwitterComposeFail (TwitterKit.Unity.ApiError _error) [0x00007] in D:\Projects\Social\Assets\Scripts\Social\TwitterShare.cs:102
at TwitterKit.Internal.TwitterComponent.TweetFailed (System.String error) [0x00023] in D:\Projects\Social\Assets\Twitter\Scripts\TwitterComponent.cs:92
I also tried uploading a video using the REST API, I made a post on this forum for that too:
Any help would be great, thank you