Twitter client primarily targeted to Magic Leap on Unity.
// Read video file from storage
byte[] video = File.ReadAllBytes(videoFilePath);
// Upload the video to Twitter (this is just a media upload; not a tweet)
string videoMediaId = await _client.UploadVideo(video, (upload, encode) =>
{
Debug.Log($"Uploading: {upload * 100:0}% done, encoding: {encode * 100:0}% done...");
});
// Tweet the video
await _client.UpdateStatus("Uploading a video capture", videoMediaId);
- 3-legged OAuth (demo included)
- PIN-based OAuth
- App authentication
- Update status aka "tweeting" (demo included)
- Upload media with image/video (demo included)
- General GET/POST methods with OAuth header
- User authentication (3-legged OAuth) using Helio
- Fetch and present a user profile on Unity UI
- Capture and upload video to Twitter media server
- Tweet with entities: URL links and media
To run the demo on your own:
- Instantiate
Demo/CredentialRepository.cs- Right click →
Create→Scriptable Object
- Right click →
- Fill in the repository's text fields with your Twitter app credentials
- Pass the repository to
DemoControllerinDemo/DemoScene.scene - Run that scene on Magic Leap
- Unity version 2019.1 and later
- C# 7 language features
- UniRx
- Primarily for myself and developing inconsistently (issues & PRs are appreciated)
- MIT license
- I couldn't find any loyalty-free cross-platform Twitter clients for Unity (except broken ones) so decided to make my own. The core is completely managed in .NET Standard 2.0 and survives IL2CPP so it should be portable to the majority of platforms including upcoming smartglasses; as PoC it works in Lumin runtime.