WXMiniProgramObject *object = [WXMiniProgramObject object];
object.webpageUrl = webpageUrl;
object.userName = userName;
object.path = path;
object.hdImageData = hdImageData;
object.withShareTicket = withShareTicket;
object.miniProgramType = programType;
WXMediaMessage *message = [WXMediaMessage message];
message.title = @"小程序标题";
message.description = @"小程序描述";
message.thumbData = nil; //兼容旧版本节点的图片,小于32KB,新版本优先
//使用WXMiniProgramObject的hdImageData属性
message.mediaObject = object;
SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
req.bText = NO;
req.message = message;
req.scene = WXSceneSession; //目前只支持会话
[WXApi sendReq:req];WXMiniProgramObject *object = [WXMiniProgramObject object];
object.webpageUrl = webpageUrl;
object.userName = userName;
object.path = path;
object.hdImageData = hdImageData;
object.withShareTicket = withShareTicket;
object.miniProgramType = programType;
WXMediaMessage *message = [WXMediaMessage message];
message.title = @"小程序标题";
message.description = @"小程序描述";
message.thumbData = nil; //兼容旧版本节点的图片,小于32KB,新版本优先
//使用WXMiniProgramObject的hdImageData属性
message.mediaObject = object;
SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
req.bText = NO;
req.message = message;
req.scene = WXSceneSession; //目前只支持会话
[WXApi sendReq:req];https://developers.weixin.qq.com/miniprogram/introduction/ 使用上述代码,hdImageData为app本地图片,png/jpg/jpeg格式图片、宽高比5:4,大小50几KB分享过程持续5分钟,13KB分享过程30几秒,整个用户体验很差。