ShareSDKImpl.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. using System;
  2. using System.Collections;
  3. namespace cn.sharesdk.unity3d {
  4. public abstract class ShareSDKRestoreSceneImpl
  5. {
  6. public virtual void setRestoreSceneListener() {}
  7. }
  8. public abstract class ShareSDKImpl
  9. {
  10. /// <summary>
  11. /// Init the ShareSDK.
  12. /// <summary>
  13. public abstract void InitSDK(string appKey);
  14. public abstract void InitSDK(string appKey, string secret);
  15. /// <summary>
  16. /// add listener for loopshare
  17. /// <summary>
  18. public abstract void PrepareLoopShare();
  19. /// <summary>
  20. /// set channel Id
  21. /// <summary>
  22. public abstract void setChannelId();
  23. /// <summary>
  24. /// Sets the platform config.
  25. /// <summary>
  26. public abstract void SetPlatformConfig(Hashtable configs);
  27. /// <summary>
  28. /// Authorize the specified platform.
  29. /// <summary>
  30. public abstract void Authorize(int reqId, PlatformType platform);
  31. /// <summary>
  32. /// Removes the account of the specified platform.
  33. /// <summary>
  34. public abstract void CancelAuthorize(PlatformType platform);
  35. /// <summary>
  36. /// Determine weather the account of the specified platform is valid.
  37. /// <summary>
  38. public abstract bool IsAuthorized(PlatformType platform);
  39. /// <summary>
  40. /// Determine weather the APP-Client of platform is valid.
  41. /// <summary>
  42. public abstract bool IsClientValid(PlatformType platform);
  43. /// <summary>
  44. /// Request the user info of the specified platform.
  45. /// <summary>
  46. public abstract void GetUserInfo(int reqId, PlatformType platform);
  47. /// <summary>
  48. /// Share the content to the specified platform with api.
  49. /// <summary>
  50. public abstract void ShareContent(int reqId, PlatformType platform, ShareContent content);
  51. /// <summary>
  52. /// Share the content to the specified platform with api.
  53. /// <summary>
  54. public abstract void ShareContent(int reqId, PlatformType[] platforms, ShareContent content);
  55. /// <summary>
  56. /// Show the platform list to share.
  57. /// <summary>
  58. public abstract void ShowPlatformList(int reqId, PlatformType[] platforms, ShareContent content, int x, int y);
  59. /// <summary>
  60. /// OGUI share to the specified platform.
  61. /// <summary>
  62. public abstract void ShowShareContentEditor(int reqId, PlatformType platform, ShareContent content);
  63. /// <summary>
  64. /// share according to the name of node<Content> in ShareContent.xml(in ShareSDKConfigFile.bunle,you can find it in xcode - ShareSDK folider) [only valid in iOS temporarily)]
  65. /// <summary>
  66. public abstract void ShareWithContentName(int reqId, PlatformType platform, string contentName, Hashtable customFields);
  67. /// <summary>
  68. /// show share platform list according to the name of node<Content> in ShareContent.xml file(in ShareSDKConfigFile.bunle,you can find it in xcode - ShareSDK folider) [only valid in iOS temporarily)]
  69. /// <summary>
  70. public abstract void ShowPlatformListWithContentName(int reqId, string contentName, Hashtable customFields, PlatformType[] platforms, int x, int y);
  71. /// <summary>
  72. /// show share content editor according to the name of node<Content> in ShareContent.xml file(in ShareSDKConfigFile.bunle,you can find it in xcode - ShareSDK folider) [only valid in iOS temporarily)]
  73. /// <summary>
  74. public abstract void ShowShareContentEditorWithContentName(int reqId, PlatformType platform, string contentName, Hashtable customFields);
  75. /// <summary>
  76. /// Gets the friend list.
  77. /// <summary>
  78. public abstract void GetFriendList(int reqID, PlatformType platform, int count, int page);
  79. /// <summary>
  80. /// Follows the friend.
  81. /// <summary>
  82. public abstract void AddFriend(int reqID, PlatformType platform, string account);
  83. /// <summary>
  84. /// Gets the auth info.
  85. /// <summary>
  86. public abstract Hashtable GetAuthInfo(PlatformType platform);
  87. /// <summary>
  88. /// the setting of SSO
  89. /// <summary>
  90. public abstract void DisableSSO(bool disable);
  91. /// <summary>
  92. /// Open Wechat miniProgram
  93. /// <summary>
  94. public abstract bool openMiniProgram(string userName, string path, int miniProgramType);
  95. public abstract void getWXRequestToken();
  96. public abstract void getWXRefreshToken();
  97. public abstract void sendWXRefreshToken(string token);
  98. public abstract void sendWXRequestToken(string uid, string token);
  99. #if UNITY_ANDROID
  100. public abstract void isClientValidForAndroid(int reqID,PlatformType platform);
  101. #endif
  102. #if UNITY_IPHONE || UNITY_IOS
  103. /// <summary>
  104. /// 获取MobSDK隐私协议内容, url为true时返回MobTech隐私协议链接,false返回协议的内容
  105. /// <summary>
  106. public abstract void shareSDKWithCommand(Hashtable content);
  107. /// <summary>
  108. /// Share the content to the specified platform with api.
  109. /// <summary>
  110. public abstract void ShareContentWithActivity(int reqID, PlatformType platform, ShareContent content);
  111. #endif
  112. #if UNITY_ANDROID
  113. /// <summary>
  114. /// 获取MobSDK隐私协议内容, url为true时返回MobTech隐私协议链接,false返回协议的内容
  115. /// <summary>
  116. public abstract void setDisappearShareToast(bool url);
  117. #endif
  118. }
  119. }