簡體   English   中英

Whatsapp API old_version 錯誤

[英]Whatsapp API old_version error

我一直在嘗試讓我的 whatsapp 控制台應用程序工作。 不幸的是,在嘗試注冊時出現錯誤:old_version。 這是我的程序在控制台中記錄的內容(程序代碼如下):

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"}

有誰知道我如何更新 whatsapp API? 它是我的 NuGet 包管理器中當前的最新版本。 我知道有兩個版本,我都試過都沒有成功。

我正在使用 .NET 框架解決方案而不是 .NET 核心,因為我正在處理由微軟引起的 NuGet 包管理器錯誤。 此外,我還在 .NET 框架中使用其他 NuGet 包,如 Discord.NET。

所以我可以在 NuGet 包管理器中找到 2 個 Whatsapp API。 API 的第一個版本是 v1.2.2,另一個版本是 v15.4.29。

另外我想添加我用於注冊的代碼。

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

要完全重現錯誤: https ://pastebin.com/EJhjALwz 使用前面提到的兩個可用 nuget 包(v1.2.2 或 v15.4.29 上的那個包)

我期待任何對 API 或編碼有更多了解的人可以幫助我解決這個挫折。

下載github這個項目試試這個配置:

    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
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM