Replies: 2 comments
-
|
its solved. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@uimeet Hello, Could you share how to solve this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am attempting to make an ExtendedTextMessage to send a Link Preview to a stranger.
I can display the Link Preview correctly on my end, but it doesn't work on the other end.
Is there any way to solve this problem?
Here is my code:
` thumb := buf.Bytes()
resp1, _ := self.client.Upload(context.Background(), thumb, "WhatsApp Link Thumbnail Keys")
jpeg_config, err := png.DecodeConfig(bytes.NewReader(thumb))
message := &waProto.Message{
ExtendedTextMessage: &waProto.ExtendedTextMessage{
Text: proto.String(req.Link),
Title: proto.String("NNY Download apk test title"),
Description: proto.String("NNY Download apk —— Get Free Now"),
MatchedText: proto.String(req.Link),
JPEGThumbnail: thumb,
PreviewType: waProto.ExtendedTextMessage_NONE.Enum(),
},
}
message.ExtendedTextMessage.MediaKey = resp1.MediaKey
message.ExtendedTextMessage.MediaKeyTimestamp = proto.Int64(time.Now().Unix())
message.ExtendedTextMessage.ThumbnailDirectPath = &resp1.DirectPath
message.ExtendedTextMessage.ThumbnailSHA256 = resp1.FileSHA256
message.ExtendedTextMessage.ThumbnailEncSHA256 = resp1.FileEncSHA256
if err != nil {
fmt.Printf("error: %v\n", err)
} else {
message.ExtendedTextMessage.ThumbnailHeight = proto.Uint32(uint32(jpeg_config.Height))
message.ExtendedTextMessage.ThumbnailWidth = proto.Uint32(uint32(jpeg_config.Width))
}
Beta Was this translation helpful? Give feedback.
All reactions