Parse.com エラー ログに次のエラーが表示されます。
E2015-09-28T12:40:37.531Z]ユーザー gI8UxW2JNa の MPPChatRoom でトリガーされた vWEB after_save:
入力: {"オブジェクト":{"カウンター":0,"createdAt":"2015-09-18T12:35:28.195Z","説明":"ミルトンのクライアント","lastMessage":"VGVzdA==\ n","lastUser":{"__type":"Pointer","className":"_User","objectId":"Eoi7gcQ4Rs"},"memberCount":2,"members":["Eoi7gcQ4Rs","gI8UxW2JNa "],"mppfile":{"__type":"Pointer","className":"MPPFile","objectId":"3tZWUNHXlf"},"objectId":"jZS5dhQPna","owner":{"__type": "ポインタ","className":"_User","objectId":"Eoi7gcQ4Rs"},"roomId":"88b17cd0-63cd-40c7-8b7a-3b6d356768be","status":1,"title":"Tom Grey","updatedAction":{"__type":"Date","iso":"2015-09-18T12:59:19.995Z"},"updatedAt":" 2015-09-28T12:40:37.528Z","user":{"__type":"Pointer","className":"_User","objectId":"gI8UxW2JNa"}}}
結果: 無効な JSON
そのクラスにはカスタムの after_save クラウド コード関数がないため、これについて頭を悩ませています。ただし、そのクラスの after_save 用の webhook があります。
Webhook タイプ: afterSave、クラス: MPPChatRoom、URL: https:// my domain /messagePush/parseMessagePush.php
after_save であるため、入力を制御できず、上記の入力を見ると、JSON にも問題はありません。上記の json は、コピーしてhttps://jsonformatter.curiousconcept.com/に貼り付けると有効になります。
誰でも助けることができますか?
編集 1: 私は webhook を初めて使用し、PHP 開発者ではないので、Parse ではなく PHP がエラーを生成していると想定していますか? 初期コードは次のとおりです。
include "../includes/config.inc.php";
$sql_object = new sql_class('parseMessagePush.php');
ob_start();
echo "<pre>";
print_r($_POST);
print_r($_GET);
print_r($_SERVER);
print_r(json_decode(file_get_contents('php://input'), true));
$dataLog = json_decode(file_get_contents('php://input'), true);
私は今、これらの json_decode 呼び出しの 1 つが例外を引き起こしていると考えています。Parse が無効な json を送信する理由はわかりませんが。