All Projects → sassembla → toriki

sassembla / toriki

Licence: MIT license
Unity Twitter Login/API kit.

Programming Languages

C#
18002 projects
objective c
16641 projects - #2 most used programming language
Objective-C++
1391 projects

Toriki

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 in releases.

usage

1. setup Twitter ConsumerKey and ConsumerSecret

static TwitterSettings()
{
    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",
    new SortedDictionary<string, string>
    {
        {"status", "#LoveToriki. "}
    },
    result =>
    {
        Debug.Log("update result:" + result);
    },
    (code, errors) =>
    {
        Debug.Log("update code:" + code);
    }
);

license

license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].