Todos os produtos
Search
Central de documentação

Mobile Platform as a Service:Interface ShareContent

Última atualização: Jun 28, 2026

Importante
  • Use os métodos get e set para acessar as variáveis de ShareContent.

  • O parâmetro imgUrl trata inconsistências no compartilhamento. Todas as operações priorizam a URL da imagem (imgUrl). A imagem compartilhada (image) serve como fallback.

A interface ShareContent:

public class ShareContent implements Serializable {

    /*
     * The content to share.
     */
    private String content;

    /*
     * The image to share.
     */
    private byte[] image;

    /*
     * The URL to redirect to after sharing.
     */
    private String url;

    /*
     * The title of the share.
     */
    private String title;

    /*
     * The URL of the image to share.
     * Note: To share an online image to social media feeds, first download the image to a local path. Then, pass the local path to imgUrl.
     */
    private String imgUrl;

    /*
     * Extension parameters. Used to pass business parameters, such as parameters for generating short links or for confirming successful text message delivery.
     */
    private String extData;

    /*
     * The type of content to share. "url" indicates a link. "image" indicates an image.
     */
    private String contentType;

    /*
     * For sharing to a contact: The URL of the thumbnail image in the share preview box.
     */
    private String iconUrl;

    /**
     * The URL of a local image.
     */
    private String localImageUrl;
    
    /*
    * The type of the Mini Program. The default is the release version.
    * Release version: MiniProgramType.MINIPTOGRAM_TYPE_RELEASE
    * Test version: MiniProgramType.MINIPROGRAM_TYPE_TEST
    * Preview version: MiniProgramType.MINIPROGRAM_TYPE_PREVIEW
    */
    private MiniProgramType miniprogramType;
}