예제 #1
0
 /// <summary>
 /// Opens this <c>Gate</c> if the social action that was finished causes the
 /// <c>Gate</c>'s criteria to be met.
 /// </summary>
 /// <param name="provider">Social provider related to the action that was finished.</param>
 /// <param name="socialActionType">The type of the social action that was finished.</param>
 /// <param name="payload">Payload to compare with this <c>Gate</c>'s ID.</param>
 protected void onSocialActionFinished(Provider provider, SocialActionType socialActionType, string payload)
 {
     if (payload == this.ID)
     {
         ForceOpen(true);
     }
 }
 private void onSocialActionFailed(Provider provider, SocialActionType action, string message, string payload)
 {
     if (provider == Provider.TWITTER)
     {
         if (action == SocialActionType.UPDATE_STORY)
         {
             if (SceneManager.GetActiveScene().name == "menu")
             {
                 MenuController.instance.NotificationMessage("Connection Failed");
             }
         }
     }
 }
 void onSocialActionFailed(Provider provider, SocialActionType action, string message, string payload)
 {
     if (provider == Provider.TWITTER)
     {
         if (action == SocialActionType.UPDATE_STORY)
         {
             if (Application.loadedLevelName == "MainMenu")
             {
                 MenuController.instance.NotificationMessage("Could Not Post");
             }
         }
     }
 }
 void onSocialActionFinished(Provider provider, SocialActionType action, string payload)
 {
     if (provider == Provider.TWITTER)
     {
         if (action == SocialActionType.UPDATE_STORY)
         {
             if (Application.loadedLevelName == "MainMenu")
             {
                 MenuController.instance.NotificationMessage("Thank You For Sharing");
             }
         }
     }
 }
 public void onSocialActionCancelled(Provider provider, SocialActionType action, string payload)
 {
     if (provider == Provider.TWITTER)
     {
         if (action == SocialActionType.UPDATE_STORY)
         {
             if (SceneManager.GetActiveScene().name == "MainMenu")
             {
                 MenuController.instance.NotificationMessage("Could not post");
             }
         }
     }
 }
            public void OnAppInviteComplete(string message)
            {
                SocialActionType actionType = SocialActionType.INVITE;
                JSONObject       eventInfo  = new JSONObject(message);

                if (didComplete(eventInfo))
                {
                    StansAssetsGrowIntegration.Instance.OnSocialActionFinished(PROVIDER, actionType);
                }
                else if (isCancelled(eventInfo))
                {
                    StansAssetsGrowIntegration.Instance.OnSocialActionCancelled(PROVIDER, actionType);
                }
                else                     // if eventInfo ["error"]
                {
                    StansAssetsGrowIntegration.Instance.OnSocialActionFailed(PROVIDER, actionType);
                }
                DelegateMessage(message);
            }
            public void OnShareLinkComplete(string message)
            {
                SocialActionType actionType = SocialActionType.UPDATE_STORY;
                JSONObject       eventInfo  = new JSONObject(message);

                if (eventInfo ["postId"] || eventInfo ["id"])
                {
                    StansAssetsGrowIntegration.Instance.OnSocialActionFinished(PROVIDER, actionType);
                }
                else if (isCancelled(eventInfo) || didComplete(eventInfo) || eventInfo ["posted"])
                {
                    StansAssetsGrowIntegration.Instance.OnSocialActionCancelled(PROVIDER, actionType);
                }
                else                     // if eventInfo ["error"]
                {
                    StansAssetsGrowIntegration.Instance.OnSocialActionFailed(PROVIDER, actionType);
                }

                DelegateMessage(message);
            }
예제 #8
0
    // Give reward avatars when successfully posting to facebook or twitter
    public void onSocialActionFinished(Provider provider, SocialActionType action, string payload)
    {
        // provider is the social provider
        // action is the social action (like, post status, etc..) that finished
        // payload is an identification string that you can give when you initiate the social action operation and want to receive back upon its completion

        string social_provider = payload;

        Debug.Log(provider);

        if (social_provider == "facebook")
        {
            RewardedAvatars.incrementAvatarBalance(RewardedAvatars.ghost_avatar_rwd);
            RewardedAvatars.incrementAvatarBalance(RewardedAvatars.ghost_tail_rwd);
        }
        else if (social_provider == "twitter")
        {
            RewardedAvatars.incrementAvatarBalance(RewardedAvatars.star_avatar_rwd);
            RewardedAvatars.incrementAvatarBalance(RewardedAvatars.star_tail_rwd);
        }
    }
예제 #9
0
 public void SocialActionCanceled(Provider provider, SocialActionType action, string payload)
 {
 }
예제 #10
0
 public void SocialActionFailed(Provider provider, SocialActionType action, string message, string payload)
 {
 }
예제 #11
0
 public void SocialActionFinished(Provider provider, SocialActionType action, string payload)
 {
 }
예제 #12
0
 private void OnSocialActionFailed(Provider provider, SocialActionType type, string error, string payload)
 {
     Debug.Log("Social action failed with error message: " + error);
 }
예제 #13
0
 private void OnSocialActionCancelled(Provider provider, SocialActionType type, string payload)
 {
     Debug.Log("Social action cancelled");
 }
예제 #14
0
 private void OnSocialActionFinished(Provider provider, SocialActionType type, string payload)
 {
     Debug.Log("Social action finished. Provider: " + provider.ToString() + " Action: " + type.ToString());
 }