Пример #1
0
 public void TestInitialise()
 {
     roar    = new MockRoar();
     roarApi = roar as IRoar;
     roar.Awake();
     requestSender = roar.api as MockRequestSender;
 }
Пример #2
0
    void OnMouseDown()
    {
        Debug.Log("OnMouseDown Called");
        IRoar roar = DefaultRoar.Instance;

        roar.User.Login("mike", "mike", onLogin);
    }
Пример #3
0
 public void TestInitialise()
 {
     roar = new MockRoar();
     roarApi = roar as IRoar;
     roar.Awake();
     requestSender = roar.api as MockRequestSender;
 }
Пример #4
0
 public void TestInitialise()
 {
     IXMLNodeFactory.instance = new SystemXMLNodeFactory();
     roar = new MockRoar();
     roarApi = roar as IRoar;
     roar.Awake();
     requestSender = roar.api as MockRequestSender;
 }
Пример #5
0
    public static void Init( string applicationId )
    {
        Debug.Log("FacebookBinding.Init called with "+applicationId);
        //this application id can be derived either from a variable in the unity3d script (entered in the inspector)
        //or can be retrieved from the webapi since there is an option to enter it in the admin panel.

        roar = DefaultRoar.Instance;
    }
Пример #6
0
    /**
       * Creates a user based on the facebook oauth with the requested username.
       *
       *
       * @param Requested name.
       **/
    public static void CreateFacebookOAuth(string requestedName)
    {
        roar = DefaultRoar.Instance;
        if(oAuthToken != null)
        {

            roar.CreateFacebookOAuthToken(requestedName, oAuthToken);
        }
    }
Пример #7
0
    static void onLogin(Roar.CallbackInfo <Roar.WebObjects.User.LoginResponse> info)
    {
        Debug.Log("onLogin Called");
        Debug.Log(info);
        Debug.Log(info.code);
        Debug.Log(info.msg);
        Debug.Log(info.data);
        IRoar roar = DefaultRoar.Instance;

        roar.Shop.Fetch(onShopFetch);
    }
Пример #8
0
    /**
       * Function that is called from javascript and is passed the signedRequest string
       *
       *
       * @param signedRequest is the actual signed request picked up from facebook 'POST'
       **/
    void CatchFacebookRequest(string signedR)
    {
        roar = DefaultRoar.Instance;
        if (signedR == "")
        {
            //fire signed request event failed. go for the graph api method.
            RequestFacebookGetCode();

        }
        else
        {
            //fire events related to signed request or signed auth.
            oAuthToken = signedR;
            AttemptLogin();
            //roar.LoginFacebookOAuth(signedR);
        }
    }
Пример #9
0
    /**
       * Function that is called from javascript and is handed the facebook code parameter. Call graph.authorize with this.
       *
       *
       * @param code is the get parameter picked up from facebook 'GET'. Can be null.
       **/
    void CatchCodeGetPara(string paras)
    {
        roar = DefaultRoar.Instance;
        if(paras.Split(' ')[0] == "")
        {
            //Invoke redirect with authorization.
            //fire event that says we are redirecting to login/authorize.

            Debug.Log("redirecting because of a blank code");
            Application.OpenURL("https://graph.facebook.com/oauth/authorize?client_id="+applicationID+"&redirect_uri="+paras.Split(' ')[1]);

        }
        else
        {
            Debug.Log("got string para");
            Debug.Log("string is "+paras);
            codeParameter = paras.Split(' ')[0];
            //FacebookManager.OnOAuthTokenReady();
            //AttemptLogin();
            // move on to fetch oauth.
            //Hashtable h = new Hashtable();
            //h.Add("code", codeParameter);
            roar.FetchFacebookOAuthToken(codeParameter, onOAuthTokenFetch);

        }
    }
Пример #10
0
    // Use this for initialization
    void Start()
    {
        IRoar roar = DefaultRoar.Instance;

        roar.User.Login("mike", "mike", onLogin);
    }