Importante
Utilice los métodos
getysetpara acceder a las variables deShareContent.El parámetro
imgUrlgestiona las inconsistencias al compartir contenido. Todas las operaciones de uso compartido priorizan la URL de la imagen (imgUrl). La imagen compartida (image) se usa como alternativa.
La interfaz 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;
}