Rhymen / go-whatsapp

WhatsApp Web API
MIT License
2.05k stars 490 forks source link

Unable to login #596

Open mateors opened 2 years ago

mateors commented 2 years ago

error logging in: error during login: error decoding login resp: json: cannot unmarshal array into Go value of type map[string]interface {}

akbarfa49 commented 2 years ago

error logging in: error during login: error decoding login resp: json: cannot unmarshal array into Go value of type map[string]interface {}

where the code sir? addition: if u didn't SetClientVersion, u need to set it first. example :

wac, err := whatsapp.NewConn(3 * time.Minute)
wac.SetClientVersion(2, 2123, 7)
alimsk commented 2 years ago

i got the same error

this is the code

qrChan := make(chan string)
go func() {
    fmt.Print(<-qrChan)
}()
session, err = conn.Login(qrChan) // <-- here is the error
alimsk commented 2 years ago

@akbarfa49 your suggestion works, thank you :)