Пример #1
0
 private void OnShare(IShareResult result)
 {
     if (result.Cancelled || !string.IsNullOrEmpty(result.Error))
     {
         print("Sharelink error: " + result.Error);
     }
     else if (!string.IsNullOrEmpty(result.PostId))
     {
         print(result.PostId);
     }
     else
     {
         print("Share succeed");
         if (!PlayerPrefs.HasKey("shareCoinClaimed"))
         {
             txtStatus.text = "You received 10 coins for sharing!";
             PlayerPrefs.SetInt("PlayerGold", PlayerPrefs.GetInt("PlayerGold") + 10);
             PlayerPrefs.SetInt("shareCoinClaimed", 1);
             sfxCoins.Play();
         }
         else
         {
             txtStatus.text = "Thank you for sharing with your friends!";
         }
     }
 }
Пример #2
0
        void ShareMessengerCallback(IShareResult result)
        {
            FacebookHelperResultType resultType = FacebookHelperResultType.ERROR;

            if (result != null)
            {
                if (result.Error == null || result.Error == "")
                {
                    var    responseObject = Json.Deserialize(result.RawResult) as Dictionary <string, object>;
                    object obj            = 0;
                    if (responseObject.TryGetValue("cancelled", out obj))
                    {
                        resultType = FacebookHelperResultType.CANCELLED;
                    }
                    else if (responseObject.TryGetValue("id", out obj))
                    {
                        resultType = FacebookHelperResultType.OK;

                        if (doneCallback != null)
                        {
                            doneCallback();
                        }
                    }
                }
            }
        }
Пример #3
0
        public void SimpleFeedShare()
        {
            IShareResult result = null;

            FB.FeedShare(link: new Uri("https://www.facebook.com"), callback: (r) => (result = r));
            Assert.IsNotNull(result);
        }
Пример #4
0
 private void OnShare(IShareResult result)
 {
     if (result.Cancelled || !string.IsNullOrEmpty(result.Error))
     {
         Debug.Log("ShareLink Error " + result.Error);
     }
 }
Пример #5
0
 void OnFeedPostComplete(IShareResult result)
 {
     if (OnPostToWall != null)
     {
         OnPostToWall(DeserializeFBResult(result.RawResult));
     }
 }
Пример #6
0
 private void SharePointsCallBack(IShareResult result)
 {
     if (result.Error != null || result.Cancelled)
     {
         StartCoroutine(this.GetComponent <MenuManagerScript>().ToggleInfoPanel("Something went wrong while posting... :(", true));
     }
 }
Пример #7
0
    private void ShareLinkCallback(IShareResult result)
    {
        if (result.Cancelled || !String.IsNullOrEmpty(result.Error))
        {
            Debug.Log("ShareLink Error: " + result.Error);
            if (onShareLinkFail != null)
            {
                onShareLinkFail();
            }
        }
        else if (!String.IsNullOrEmpty(result.PostId))
        {
            // Print post identifier of the shared content
            Debug.Log("ShareLink success with postID!");

            if (onShareLinkComplete != null)
            {
                onShareLinkComplete();
            }
            Debug.Log(result.PostId);
        }
        else
        {
            // Share succeeded without postID
            if (onShareLinkComplete != null)
            {
                onShareLinkComplete();
            }
            Debug.Log("ShareLink success without postID!");
        }
    }
Пример #8
0
 static void ShareAction(IShareResult result)
 {
     if (!result.Cancelled && act != null)
     {
         act();
     }
 }
Пример #9
0
    private void ShareCallback(IShareResult result)
    {
        if (result.Cancelled || !string.IsNullOrEmpty(result.Error))
        {
            Debug.Log("ShareLink Error: " + result.Error);
        }
        else if (!string.IsNullOrEmpty(result.PostId))
        {
            // Print post identifier of the shared content
            Debug.Log(result.PostId);
        }
        else
        {
            // Share succeeded without postID
            Debug.Log("ShareLink success!");
        }

        switch (MainController.single.gameState)
        {
        case MainController.GameState.DestroyCity:
            LevelControl.shareStatus = ShareStatus.Recieved;
            break;

        case MainController.GameState.PhoneCamera:
            PhoneImageController.shareStatus = ShareStatus.Recieved;
            break;

        default:
            break;
        }
    }
Пример #10
0
 public void Compartido(IShareResult fd)
 {
     if (!fd.Cancelled)
     {
         DataManager.Instance.GuardarDatos((byte?)(DataManager.Instance.getVidasRestantes() + 2), null);
         DataManager.Instance.CargarDatos();
     }
 }
Пример #11
0
 private static void ShareCallback (IShareResult result)
 {
     Debug.Log("ShareCallback");
     if (result.Error != null)
     {
         Debug.LogError(result.Error);
         return;
     }
     Debug.Log(result.RawResult);
 }
Пример #12
0
 private static void ShareCallback(IShareResult result)
 {
     Debug.Log("ShareCallback");
     if (result.Error != null)
     {
         Debug.LogError(result.Error);
         return;
     }
     Debug.Log(result.RawResult);
 }
Пример #13
0
 private void OnShare(IShareResult result)
 {
     if (result.Cancelled || !string.IsNullOrEmpty(result.Error))
     {
     }
     else
     {
         AchievementsManager.Instance.CheckAchievements(TasksTypes.Share);
     }
 }
Пример #14
0
 private void ShareLinkCallback(IShareResult result)
 {
     if (result.Cancelled)
     {
         Debug.Log("Share cancelled");
     }
     else
     {
         Debug.Log("Share successfully");
     }
 }
Пример #15
0
 private void ShareCallback(IShareResult result)
 {
     if (result.Cancelled || !String.IsNullOrEmpty(result.Error))
     {
         AnalyticsManager.SharedToFacebook(false);
     }
     else
     {
         AnalyticsManager.SharedToFacebook(true);
     }
 }
Пример #16
0
 public void ShareCallBack(IShareResult result)
 {
     if (result.Cancelled)
     {
         Debug.Log("User Cancelled");
     }
     else
     {
         Debug.Log("Link Shared");
     }
 }
Пример #17
0
    private void OnShareCB(IShareResult result)
    {
        bool   isSuccess;
        string message;

        HandleResult(result, out isSuccess, out message);
        if (_onShareCB != null)
        {
            _onShareCB(isSuccess, message);
        }
    }
Пример #18
0
 private void ShareCallback(IShareResult shareResult)
 {
     if (shareResult.Cancelled)
     {
         Debug.LogError("User Cancelled");
     }
     else
     {
         Debug.Log("Share successfully");
     }
 }
Пример #19
0
 private void PostOnFBCallback(IShareResult result)
 {
     if (string.IsNullOrEmpty(result.Error) && !result.Cancelled)
     {
         SetInfoText("Story Posted Successfully!");
     }
     else
     {
         SetInfoText("Error Occured!");
     }
 }
Пример #20
0
    void SharingDone(IShareResult result)
    {
        if (result.Cancelled || result.Error != null)
        {
            return;
        }
        MngmntGameHandler.instance.Tasso.TakeProfit((uint)sharingReward);
        DateTime newDate       = DateTime.Now;
        string   newStringDate = Convert.ToString(newDate);

        PlayerPrefs.SetString("PlayDate", newStringDate);
    }
Пример #21
0
 private void OnShare(IShareResult result)
 {
     if (result.Cancelled || !string.IsNullOrEmpty(result.Error))
     {
         ShareText.text = "Error Sharing :(";
     }
     else
     {
         charController.SuccesfulShareUnlock();
         ShareText.text = "Success";
     }
 }
Пример #22
0
 private static void OnPost(IShareResult result)
 {
     if (Service.GameIdleController != null)
     {
         Service.GameIdleController.Enabled = true;
     }
     if (FacebookManager.OnPostCallback != null)
     {
         FacebookManager.OnPostCallback(result);
         FacebookManager.OnPostCallback = null;
     }
 }
Пример #23
0
        public void SimpleLinkShare()
        {
            IShareResult result = null;

            FB.ShareLink(
                new Uri("http://www.test.com/"),
                "test title",
                "test description",
                new Uri("http://www.photo.com/"),
                (r) => (result = r));
            Assert.IsNotNull(result);
        }
Пример #24
0
 private void FeedCallback(IShareResult result)
 {
     if (result.Error == null && result.Cancelled == false)
     {
         UnityAndroidExtras.instance.makeToast("Thank you! Your lives are now replenished!", 1);
         gameController.FillMaxLives();
     }
     else if (result.Error != null)
     {
         UnityAndroidExtras.instance.makeToast("Sorry! An error has occurred!", 1);
     }
 }
Пример #25
0
 // Callback from sharing google play store link.
 private void ShareCallBackProcess(IShareResult result)
 {
     if (!String.IsNullOrEmpty(result.PostId))
     {
         // Print post identifier of the shared content.
         Cus.LogAMessage("[Facebook SDK]: Successfully Shared a Link, post id: \n" + result.PostId);
     }
     else
     {
         // Share succeeded without postID.
         Cus.LogAMessage("[Facebook SDK]: Failed to Share a Link, because: \n" + result.Error);
     }
 }
        public void SharePhotoWithTexture2D()
        {
            IShareResult result = null;

            FB.SharePhoto(
                Texture2D.blackTexture,
                callback: (r) => {
                result = r;
            });

            Assert.IsNotNull(result);
            FacebookLogger.Log(result.RawResult);
        }
Пример #27
0
 private void ShareCallback(IShareResult result)
 {
     if (result.Cancelled || result.Error != null)
     {
         Debug.Log("ShareLink Error: " + result.Error);
     }
     else if (result.PostId != null)
     {
         Debug.Log(result.PostId);
     }
     else
     {
         Debug.Log("ShareLink success!");
     }
 }
Пример #28
0
 private void OnShare(IShareResult result)
 {
     if (result.Cancelled || !string.IsNullOrEmpty(result.Error))
     {
         Debug.Log("sharing error: " + result.Error);
     }
     else if (!string.IsNullOrEmpty(result.PostId))
     {
         Debug.Log(result.PostId);
     }
     else
     {
         Debug.Log("Share sucessfull");
     }
 }
Пример #29
0
 private void ShareCallback(IShareResult result)
 {
     if (result.Cancelled || !String.IsNullOrEmpty(result.Error))
     {
         Debug.Log("ShareLink Error: " + result.Error);
     }
     else if (!String.IsNullOrEmpty(result.PostId))
     {
         Debug.Log(result.PostId);
     }
     else
     {
         Debug.Log("ShareLink success!");
     }
 }
Пример #30
0
 void OnShare(IShareResult result)
 {
     if (result.Cancelled || !string.IsNullOrEmpty(result.Error))
     {
         Debug.Log("ShareLink Error: " + result.Error);
     }
     else if (!string.IsNullOrEmpty(result.Error))
     {
         Debug.Log(result.PostId);
     }
     else
     {
         Debug.Log("Share complete");
     }
 }
Пример #31
0
 private void OnShare(IShareResult result)
 {
     if (result.Cancelled || !string.IsNullOrEmpty(result.Error))
     {
         Debug.Log("ShareLink error " + result.Error);
     }
     else if (!string.IsNullOrEmpty(result.PostId))
     {
         Debug.Log(result.PostId);
     }
     else
     {
         Debug.Log("Share succeed");
     }
 }
Пример #32
0
	private void PostCallback(IShareResult result) {
		FB_PostResult res =  new FB_PostResult(result.RawResult, result.Error);
		SPFacebook.Instance.PostCallback(res);
	}
Пример #33
0
 public void FeedCallback(IShareResult result)
 {
     Debug.Log(result.RawResult);
 }
Пример #34
0
 private void ShareCallback(IShareResult result)
 {
     if (result.Cancelled || !string.IsNullOrEmpty(result.Error))
     {
         Debug.Log("ShareLink Error: " + result.Error);
     }
     else if (!string.IsNullOrEmpty(result.PostId))
     {
         // Print post identifier of the shared content
         Debug.Log(result.PostId);
     }
     else {
         // Share succeeded without postID
         Debug.Log("ShareLink success!");
     }
 }
Пример #35
0
 private void ShareCallback(IShareResult result)
 {
     if (result.Cancelled || !String.IsNullOrEmpty(result.Error))
     {
         Debug.Log("ShareLink Error: " + result.Error);
     }
     else
     {
         // Share succeeded without postID
         Debug.Log("ShareLink success!");
     }
 }
Пример #36
0
	void FeedCallback(IShareResult result){
		Debug.Log("Worked");
	}
Пример #37
0
    private void ShareCallback(IShareResult result)
    {
        Application.CaptureScreenshot ("HighScore.png");

        if (result.Cancelled || !String.IsNullOrEmpty (result.Error)) {
            Debug.Log ("ShareLink Error: " + result.Error);
        } else if (!String.IsNullOrEmpty (result.PostId)) {
            // Print post identifier of the shared content
            Debug.Log (result.PostId);
        } else {
            // Share succeeded without postID
            Debug.Log ("ShareLink success!");
        }
    }