do {
let image = UIImage(named: "logo")
let imageObject = WXImageObject()
imageObject.imageData = (image?.jpegData(compressionQuality: 0.7))!
let message = WXMediaMessage()
message.thumbData = image?.jpegData(compressionQuality: 0.3)
message.mediaObject = imageObject
let req = SendMessageToWXReq()
req.bText = false
req.message = message
req.scene = Int32(WXSceneTimeline.rawValue)
WXApi.send(req)
} catch {
print("\(error)")
}
someView.onOpenURL { url in
WXApi.handleOpenUniversalLink(NSUserActivity(activityType: "\(url)"), delegate: wxdelegate)
}
debug console 里面会有2021-07-01 19:20:10.881774+0800 weridego[11676:4327226] PBItemCollectionServicer connection disconnected.
手机上会显示"正在链接", 然后又跳回我自己的app
参考知识库自查下
https://developers.weixin.qq.com/community/develop/doc/000ce0403bc9d0ea1a0a67f415b409?highLine=sdk
wxdelegate 这里是nil