私はこのコードを見ています: https://github.com/venomous0x/WhatsAPI
ページ: /src/php/EXAMPLES.php
次の変更を加えました (修正する必要があるのはこれだけだと思います。この例では、明らかに異なる IMEI 番号と携帯電話番号を使用しています)。
$userPhone = '447799999999'; # Telephone number including the country code without '+' or '00'.
$userIdentity = '98B898B898B8'; # This is tipically the IMEI number.
# If you are using an iOS device you should input your WLAN MAC address.
$userName = 'John Doe'; # This is the username displayed by WhatsApp clients.
$destinationPhone = '447788888888'; # Destination telephone number including the country code without '+' or '00'.
# For groups: [phone number]-[group id].
$debug = TRUE;
$w->requestCode('sms', 'GB', 'en');
$w->registerCode('123456');
しかし、サーバー上のこの example.php ページに移動すると、次のエラーが表示されます。
致命的なエラー: メッセージ「コードを要求しようとしているときに問題が発生しました。in /whatsapp/src/php/whatsprot.class.php:1174 スタック トレース: #0 /whatsapp/src/php/EXAMPLES.php(49): WhatsProt->requestCode('sms', 'GB', 'en' ) #1 {main} が /whatsapp/src/php/whatsprot.class.php の 1174 行目にスローされる
どこが間違っているのか知りたいのですが、誰か光を当てることができますか? ありがとう