Important
You can use the
getandsetmethods to access the variables ofShareContent.The
imgUrlparameter handles inconsistencies in sharing. All sharing operations prioritize the image URL (imgUrl). The shared image (image) is used as a fallback.
The ShareContent interface:
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;
}