2

I've been trying to get my whatsapp Console App to work. Unfortunately when trying to register I'm getting an error: old_version. Here's what my program logs in the console (program code's below):

Succesfully connected...
Failed to log in...
  Reason: Auth response error
Phone number validation:
Type "y" in the console if you want to get a validation code send via SMS
y
SMS code send
Error with sending the request...
Reason: {"login":"mynumber","status":"fail","reason":"old_version"}

Does anyone have any idea how I could update the whatsapp API? It's the most up-to-date version currently in my NuGet package manager. I know there are two versions, I tried both without succes.

I'm using the .NET framework solution and not the .NET core because there are NuGet package manager bugs caused by microsoft that I'm dealing with. Also I'm using other NuGet packages in .NET framework like Discord.NET.

So I could find 2 Whatsapp API's in the NuGet package manger. The first version of the API is on v1.2.2, the other one is on v15.4.29.

And aditionally I want to add the code that I use for registrating.

bool registrationSucces = WhatsRegisterV2.RequestCode(number, out password, out error);

To completely reproduce the error: https://pastebin.com/EJhjALwz with both available nuget packages mentioned earlier (v1.2.2 or the one that's on v15.4.29)

I'm looking forward to anyone with more knowledge of the API or Coding that could help me solve this setback.

DutchJelly
  • 116
  • 9
  • 1
    It would be awesome if you could provide a [mcve] and mention the **explicit** package version numbers you are using. – mjwills Feb 28 '18 at 20:44
  • I edited the original post so it includes better and more information. Thanks for the feedback on how to properly post coding issues on this forum. – DutchJelly Feb 28 '18 at 20:49
  • You shoud at least provide information about the Library/NuGet package which you're using. The `WhatsRegisterV2` class matches e.g. to https://github.com/mgp25/Chat-API-NET which is pretty outdated from 2006 (before the E2EE of WA, so this surely can't work) – Lion Feb 28 '18 at 20:51
  • @Lion I did specify the version of the nuget packages I tried. Both returned the same error. Also: if my API would be really outdated, what could the cause of it be? I could not update the NuGet packages any further in my .Net Console Application – DutchJelly Feb 28 '18 at 20:54
  • Could you not negatively rate this question by the way? I'm sure more people have this problem and don't know what the cause could be. Not knowing what the cause could be is mainly my reason for maybe being a little unclear about the problem. – DutchJelly Feb 28 '18 at 20:55
  • Do you feel like you have provided a [mcve]? – mjwills Feb 28 '18 at 22:12
  • I edited again and included a pastebin link that includes enough code to reproduce the problem. I'm sorry if it's not really minimal, but I'm just trying to give all information that could cause the problem. – DutchJelly Mar 01 '18 at 10:11
  • 1
    @jellekeulemans be aware that not everybody will be able to see pastebin – phuzi Mar 01 '18 at 10:19
  • But the post will be really big and ugly if I paste all code into the post.. – DutchJelly Mar 01 '18 at 12:23

1 Answers1

0

download github this project try this configuration :

    using System;
    using System.Globalization;

    namespace WhatsAppApi.Settings
       {
               /// <summary>
               /// Holds constant information used to connect to whatsapp 
             server
                 /// </summary>
                  public class WhatsConstants
                   {
                    #region ServerConstants

        /// <summary>
        /// The whatsapp host
        /// </summary>
        public const string WhatsAppHost = "c3.whatsapp.net";

        /// <summary>
        /// The whatsapp XMPP realm
        /// </summary>
        public const string WhatsAppRealm = "s.whatsapp.net";

        /// <summary>
        /// The whatsapp server
        /// </summary>
        public const string WhatsAppServer = "s.whatsapp.net";

        /// <summary>
        /// The whatsapp group chat server
        /// </summary>
        public const string WhatsGroupChat = "g.us";

        /// <summary>
        /// The whatsapp version the client complies to
        /// </summary>
        //public const string WhatsAppVer = "2.13.21";
        //public const string WhatsAppVer = "2.12.440";
        //public const string WhatsAppVer = "2.12.556";
        public const string WhatsAppVer = "2.19.368";

        /// <summary>
        /// The port that needs to be connected to
        /// </summary>
        public const int WhatsPort = 443;

        /// <summary>
        /// iPhone device
        /// </summary>
        //  public const string Device = "S40";
        public const string Device = "Android";

        /// <summary>
        /// manufacturer
        /// </summary>
        public const string Manufacturer = "HTC";

        /// <summary>
        /// OS Version
        /// </summary>
        public const string OS_Version = "4.3";

        /// <summary>
        /// The useragent used for http requests
        /// </summary>
        //public const string UserAgent = "WhatsApp/2.13.21 S40Version/14.26 Device/Nokia302";
        //public const string UserAgent = "WhatsApp/2.12.440 Android/4.3 Device/Xiaomi-HM_1SW";
        public const string UserAgent = "WhatsApp/2.19.368 Android/4.3 Device/endeavoru-IMM76D";


        #endregion

        #region ParserConstants
        /// <summary>
        /// The number style used
        /// </summary>
        public static NumberStyles WhatsAppNumberStyle = (NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign);

        /// <summary>
        /// Unix epoch DateTime
        /// </summary>
        public static DateTime UnixEpoch = new DateTime(0x7b2, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
        #endregion
    }
}
Arian Jira
  • 11
  • 4