I have just downloaded and installed the last version of the API, however I'm getting the following error when trying to login:
error during login: error decoding login resp: json: cannot unmarshal array into Go value of type map[string]interface {}
login successful, session: {1dsbz/ii4/gklNF+Xru+wQ== [] [] }
I know there are a few issues related to this but I couldn't find any solution. It was supposed to display the Qr Code, right?
The code I'm using
package main
import (
"fmt"
"github.com/Baozisoftware/qrcode-terminal-go"
"github.com/Rhymen/go-whatsapp"
"os"
"time"
)
func main() {
wac, err := whatsapp.NewConn(5 * time.Second)
if err != nil {
panic(err)
}
qr := make(chan string)
go func() {
terminal := qrcodeTerminal.New()
terminal.Get(<-qr).Print()
}()
session, err := wac.Login(qr)
if err != nil {
fmt.Fprintf(os.Stderr, "error during login: %v\n", err)
}
fmt.Printf("login successful, session: %v\n", session)
}
Am I doing something wrong? Thank you for your reply.
Try setting the ClientVersion manually. wac.SetClientVersion(2, 2021, 4) worked for me.
0.1.0 version use an old one.
Try setting the ClientVersion manually. wac.SetClientVersion(2, 2021, 4) worked for me.
0.1.0 version use an old one.
Thank you very much! It indeed worked but now I have another issue:
I'm getting a new error when trying to restore the session:
restoring failed: admin login responded with 403
I have heard it has something to do with the token. How do I set the token?
Most helpful comment
Try setting the ClientVersion manually. wac.SetClientVersion(2, 2021, 4) worked for me.
0.1.0 version use an old one.