Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Unity Twitter Login/API kit.

License

NotificationsYou must be signed in to change notification settings

sassembla/toriki

Repository files navigation

Tori(the Twitter Bird in Japanese) kit -> Toriki.

Ultra lightweight Twitter tool for Unity. supports the SingleSignOn with Twitter app and Twitter API invocation.

Currently, Toriki requires Twitter application in supported platflorms.

supported platforms

  • iOS
  • Android
  • WebGL(under development.)

with Unity 2018.x or later.

installation

Use UnityPackage inreleases.

usage

1. setup Twitter ConsumerKey and ConsumerSecret

staticTwitterSettings(){ConsumerKey=string.Empty;// change here.ConsumerSecret=string.Empty;// change here.if(string.IsNullOrEmpty(ConsumerKey)){Debug.Log("ConsumerKey is null. please write some code for setting ConsumerKey.");}if(string.IsNullOrEmpty(ConsumerSecret)){Debug.Log("ConsumerSecret is null. please write some code for setting ConsumerSecret.");}}

2. Log in to Twitter

get AccessToken & AccessTokenSecret from Twitter.

TwitterAPI.InitWithLogin((nickname,token,secret)=>{// nickname, accesstoken, accesstokensecret is available.// also TwitterAPI is ready now.},(errorCode,message)=>{// failed to log in to Twitter.Debug.Log("login error:"+errorCode+" message:"+message);}

or

log in with stored AccessToken & AccessTokenSecret.

TwitterAPI.InitWithToken("ACCESS_TOKEN","ACCESS_SECRET");

3. Use Twitter API

after log in to Twitter, you can use Twitter APIs.

// tweet API example.TwitterAPI.Post("https://api.twitter.com/1.1/statuses/update.json",newSortedDictionary<string,string>{{"status","#LoveToriki. "}},    result=>{Debug.Log("update result:"+result);},(code,errors)=>{Debug.Log("update code:"+code);});

license

license


[8]ページ先頭

©2009-2025 Movatter.jp