PostFBMessage.cs 1008 B

123456789101112131415161718192021222324252627282930313233343536
  1. using Prime31;
  2. using UnityEngine;
  3. using System.Collections;
  4. public class PostFBMessage : MonoBehaviour
  5. {
  6. public static PostFBMessage Instance;
  7. void completionHandler(string error, object result)
  8. {
  9. if (error != null)
  10. {
  11. Debug.LogError(error);
  12. MenuManager._instance.FBShareDialog.Hide();
  13. MenuManager._instance.OnActionAfterWin();
  14. }
  15. else
  16. {
  17. //Prime31.Utils.logObject(result);
  18. MenuManager._instance.FBShareDialog.Hide();
  19. MenuManager._instance.OnActionAfterWin();
  20. }
  21. }
  22. void Start()
  23. {
  24. Instance = this;
  25. }
  26. public void PostMessageFB()
  27. {
  28. WrapperFB.PostFB();
  29. //Facebook.instance.postMessageWithLinkAndLinkToImage(Localization.instance.Get("facebook.shareChallengeWon.description"), GameConstants.PLAY_GAME_URL, Localization.instance.Get("facebook.shareChallengeWon.linkName"), GameConstants.FACEBOOK_POST_IMAGE, Localization.instance.Get("facebook.shareChallengeWon.imageCaption"), completionHandler);
  30. PlayerPrefs.SetInt("Post", 1);
  31. }
  32. }