All Products
Search
Document Center

ShareService

Last Updated: May 25, 2021

This topic describes how to use the ShareService operation, as shown in the following code:

 
  1. public abstract class ShareService extends ExternalService {
  2. /**
  3. * Silent share, only one share type can be used, share type selection will not appear.
  4. * @param content: The content to share
  5. * @param shareType: Share type
  6. * @param biz: biz
  7. */
  8. public abstract void silentShare(ShareContent content, final int shareType, final String biz);
  9. /**
  10. * Set the monitored target in sharing
  11. * @param listener: The monitored target
  12. */
  13. public abstract void setShareActionListener(ShareActionListener listener);
  14. /**
  15. * Obtain the monitored target in sharing
  16. * @return: The monitored target
  17. */
  18. public abstract ShareActionListener getShareActionListener();
  19. /**
  20. * Set the name of application
  21. * @param name: Application name
  22. */
  23. public abstract void setAppName(String name);
  24. /**
  25. * Initialize WeChat sharing
  26. * @param appId: WeChat appId, registered and obtained from WeChat channel
  27. * @param appSecret: WeChat appSecret, registered and obtained from WeChat channel
  28. */
  29. public abstract void initWeixin(String appId, String appSecret);
  30. /**
  31. * Initialize Weibo sharing
  32. * @param appId: Weibo appId, registered and obtained from Weibo channel
  33. * @param appSecret: Weibo appSecret, registered and obtained from Weibo channel
  34. * @param redirectUrl: The redirect URL for Weibo sharing
  35. */
  36. public abstract void initWeiBo(String appId, String appSecret, String redirectUrl);
  37. /**
  38. * Initialize Qzone sharing
  39. * @param appId: QZone appId, registered and obtained from QQ channel
  40. */
  41. public abstract void initQZone(String appId);
  42. /**
  43. * Initialize QQ sharing
  44. * @param appId: QQ appId, registered and obtained from QQ channel
  45. */
  46. public abstract void initQQ(String appId);
  47. /**
  48. * Initialize Alipay sharing
  49. * @param appId: Alipay appId, registered and obtained from Alipay channel
  50. */
  51. public abstract void initAlipayContact(String appId);
  52. /**
  53. * Initialize DingTalk sharing
  54. * @param appId: DingTalk appId, registered and obtained from DingTalk channel
  55. */
  56. public abstract void initDingDing(String appId);
  57. }