【问题标题】:Why is there an infinite loop in the Chat-Api?为什么 Chat-Api 会出现无限循环?
【发布时间】:2017-01-31 23:09:23
【问题描述】:

我下载了库https://github.com/mgp25/Chat-API。 这个 API whatsapp。我按照文档 (github.com/mgp25/Chat-API/wiki) 中的说明做所有事情。

首先,我编写了以下脚本:

<?php 
    require_once 'src/Registration.php';

    $debug = true;
    $username = '123456789'; //my phone number

    $w = new Registration($username, $debug);
    $w->codeRequest('sms');
?>

然后,在我的手机上收到一条带有注册代码的消息。 接下来,我编写了以下脚本:

<?php
    require_once 'src/Registration.php';

    $debug = true;
    $username = '123456789';

    $w = new Registration($username, $debug);

    $w->codeRegister('654321'); //сode, that I have received
?>

作为回应,我收到:

  [status] => ok
  [login] => login
  [pw] => password
  [type] => existing
  [expiration] => 1443256747
  [kind] => free
  [price] => 39.0
  [cost] => 0.89
  [currency] => руб
  [price_expiration] => 1414897682

接下来,我尝试登录:

<?php
    set_time_limit(10);
    require_once 'src/whatsprot.class.php';
    require_once 'src/events/MyEvents.php';

    date_default_timezone_set('Europe/Moscow');

    $username = '123456789';                 
    $password = 'password';
    $nickname = 'nickname';                    
    $debug    = true;

    $w = new WhatsProt($username, $nickname, $debug);
    $w->connect();
    $w->loginWithPassword($password);

在这里,脚本进入无限循环。 函数 loginWithPassword() 在文件 whatsprot.class.php 中:

    github.com/mgp25/Chat-API/blob/master/src/whatsprot.class.php

在第 277 行。在第 287 行调用函数 doLogin()。这个函数在文件 Login.php 中:

    github.com/mgp25/Chat-API/blob/master/src/Login.php

在第 24 行。在第 49 行是无限循环。 这里描述的同样的问题https://github.com/mgp25/Chat-API/issues/2140

【问题讨论】:

  • 我也有同样的问题..希望有人能解决..

标签: php api web whatsapp


【解决方案1】:

不幸的是,我认为 whatsapp 不再支持这个 api

【讨论】:

  • 其实我认为目前还没有官方的Whatsapp API,任何使用第三方都会违反他们的条款和条件,可能你会得到你的电话号码禁止。
猜你喜欢
  • 1970-01-01
  • 2016-08-01
  • 2010-10-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-07-13
  • 2018-11-06
相关资源
最近更新 更多