All Products
Search
Document Center

ShareContent

Last Updated: May 25, 2021

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

Note:
  • Call get and set method to access ShareContent variable.
  • Since there is no uniform standard for sharing, imgUrl is used to internally “smooth” the differences. Therefore imgUrl is the first choice for sharing, use image only if imgUrl is unavailable.
 
  1. public class ShareContent implements Serializable {
  2. /*
  3. * Content to share
  4. */
  5. private String content;
  6. /*
  7. * Share image
  8. */
  9. private byte[] image;
  10. /*
  11. * Share URL
  12. */
  13. private String url;
  14. /*
  15. * Share title
  16. */
  17. private String title;
  18. /*
  19. * Share image URL
  20. */
  21. private String imgUrl;
  22. /*
  23. * Extended parameter: Used for passing the business parameters of generating short link and SMS sending success
  24. */
  25. private String extData;
  26. /*
  27. * Sharing type: "url" is used to share the link, "image" is used to share the picture
  28. */
  29. private String contentType;
  30. /*
  31. * Share to contact: Share the URL of the small icon in the preview box
  32. */
  33. private String iconUrl;
  34. /**
  35. * Local image URL
  36. */
  37. private String localImageUrl;
  38. }