Ejemplo n.º 1
0
    private void appFeedCallback(FBResult result)
    {
        Debug.Log("appFeedCallback");

        if (result.Error != null)
        {
            Debug.Log("appFeedCallback - share request failed: " + result.Error);
        }
        else
        {
            var responseObject = Json.Deserialize(result.Text) as Dictionary <string, object>;

            object obj = null;

            if (responseObject.TryGetValue("cancelled", out obj))
            {
                Debug.Log("appFeedCallback - share request cancelled");
            }
            else if (responseObject.TryGetValue("request", out obj))
            {
                Debug.Log("appFeedCallback - share request sent");
            }
        }

#if PROPELLER_SDK
        PropellerSDK.SdkSocialShareCompleted();
#endif
    }
Ejemplo n.º 2
0
    void UserCallBack(FBResult result)
    {
        Debug.Log("UserCallBack");

        if (result.Error != null)
        {
            Debug.Log("UserCallBack - user graph request failed: " + result.Error + " - " + result.Text);

#if PROPELLER_SDK
            PropellerSDK.SdkSocialLoginCompleted(null);
#endif

            if (socialPost != SocialPost.NONE)
            {
#if PROPELLER_SDK
                switch (socialPost)
                {
                case SocialPost.INVITE:
                    PropellerSDK.SdkSocialInviteCompleted();
                    break;

                case SocialPost.SHARE:
                    PropellerSDK.SdkSocialShareCompleted();
                    break;
                }
#endif

                socialPost     = SocialPost.NONE;
                socialPostData = null;
            }

            return;
        }

        string get_data = result.Text;

        var dict = Json.Deserialize(get_data) as IDictionary;
        fbname      = dict ["name"].ToString();
        fbemail     = dict ["email"].ToString();
        fbgender    = dict ["gender"].ToString();
        fbfirstname = dict ["first_name"].ToString();

        PushFBDataToFuel();

        if (socialPost != SocialPost.NONE)
        {
            switch (socialPost)
            {
            case SocialPost.INVITE:
                onSocialInviteClicked(socialPostData);
                break;

            case SocialPost.SHARE:
                onSocialShareClicked(socialPostData);
                break;
            }
        }
    }
Ejemplo n.º 3
0
    /*
     * -----------------------------------------------------
     *                              FaceBook Share
     * -----------------------------------------------------
     */

    public void onSocialShareClicked(Dictionary <string, string> shareInfo)
    {
        Debug.Log("onSocialShareClicked");

        /*
         * string toId = "",
         * string link = "",
         * string linkName = "",
         * string linkCaption = "",
         * string linkDescription = "",
         * string picture = "",
         * string mediaSource = "",
         * string actionName = "",
         * string actionLink = "",
         * string reference = "",
         * Dictionary<string, string[]> properties = null,
         * FacebookDelegate callback = null)
         */

        if (FB.IsLoggedIn)
        {
            FB.Feed(
                FB.UserId,
                shareInfo ["link"],
                shareInfo ["subject"],
                shareInfo ["short"],
                shareInfo ["long"],
                shareInfo ["picture"],
                null,
                null,
                null,
                null,
                null,
                appFeedCallback);
        }
        else
        {
            if (socialPost != SocialPost.NONE)
            {
                socialPost     = SocialPost.NONE;
                socialPostData = null;

#if PROPELLER_SDK
                PropellerSDK.SdkSocialShareCompleted();
#endif
                return;
            }

            socialPost     = SocialPost.SHARE;
            socialPostData = shareInfo;

            trySocialLogin(false);
        }
    }
Ejemplo n.º 4
0
    void LoginCallback(FBResult result)
    {
        Debug.Log("LoginCallback");

        if (!FB.IsLoggedIn)
        {
            if (result.Error != null)
            {
                Debug.Log("LoginCallback - login request failed: " + result.Error);
            }
            else
            {
                Debug.Log("LoginCallback - login request cancelled");
            }

#if PROPELLER_SDK
            PropellerSDK.SdkSocialLoginCompleted(null);
#endif

            if (socialPost != SocialPost.NONE)
            {
#if PROPELLER_SDK
                switch (socialPost)
                {
                case SocialPost.INVITE:
                    PropellerSDK.SdkSocialInviteCompleted();
                    break;

                case SocialPost.SHARE:
                    PropellerSDK.SdkSocialShareCompleted();
                    break;
                }
#endif

                socialPost     = SocialPost.NONE;
                socialPostData = null;
            }

            return;
        }

        OnLoggedIn();
    }