收藏
回答

swiftui 如何集成微信分享?

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

回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容