Exemplo n.º 1
0
    private IEnumerator FBLoginProcess()
    {
        Debug.Log("Prompt FB login");
        yield return(StartCoroutine(FacebookWrapper.Login()));

        if (!FacebookWrapper.IsLoggedIn)
        {
            Debug.LogError("Login failed/canceled!");
        }
        else
        {
            Debug.Log("FB connected! Testing permissions.");
            FB.API("/me/permissions", HttpMethod.GET, delegate(IGraphResult response) {
                if (!string.IsNullOrEmpty(response.Error))
                {
                    Debug.LogError("Error retrieving permissions.");
                }
                else
                {
                    Debug.Log("Retrieved permissions: " + response.RawResult.ToString());
                }
            });



            WWWForm wwwForm = new WWWForm();
            wwwForm.AddField("message", "I just discovered the activity \"Monday Morning Walk\". Discover more activities at: https://choosehealthier.org/node/10374");
            wwwForm.AddBinaryData("image", tex.EncodeToPNG());
            //wwwForm.AddField("access_token", FB.AccessToken);

            //FB.API("/me/feed", Facebook.HttpMethod.POST, OnPostSuccess, wwwForm);
            FB.API("/me/photos", HttpMethod.POST, OnPostSuccess, wwwForm);
        }
    }
Exemplo n.º 2
0
    private IEnumerator LogIntoFacebookAndShare()
    {
        yield return(StartCoroutine(FacebookWrapper.Login()));

        if (FacebookWrapper.IsLoggedIn)
        {
            ShareToFacebook();
        }
    }
Exemplo n.º 3
0
        override protected void OnAwake()
        {
            base.OnAwake();


            ITTDataCache.Instance.Initialize();
            FacebookWrapper.Initialize();

            Application.RegisterLogCallback(HandleException);
        }
Exemplo n.º 4
0
    IEnumerator Start()
    {
        Debug.Log("Initializing FB");
        FacebookWrapper.Initialize();

        while (!FB.IsInitialized)
        {
            yield return(null);
        }

        Debug.Log("Starting login process");
        StartCoroutine(FBLoginProcess());
    }