{"action":"created","issue":{"url":"https://api.github.com/repos/mgp25/Instagram-API/issues/1670","repository_url":"https://api.github.com/repos/mgp25/Instagram-API","labels_url":"https://api.github.com/repos/mgp25/Instagram-API/issues/1670/labels{/name}","comments_url":"https://api.github.com/repos/mgp25/Instagram-API/issues/1670/comments","events_url":"https://api.github.com/repos/mgp25/Instagram-API/issues/1670/events","html_url":"https://github.com/mgp25/Instagram-API/issues/1670","id":270280692,"number":1670,"title":"How do you get the \"redirect message\" media?","user":{"login":"wictorChaves","id":29871621,"avatar_url":"https://avatars0.githubusercontent.com/u/29871621?v=4","gravatar_id":"","url":"https://api.github.com/users/wictorChaves","html_url":"https://github.com/wictorChaves","followers_url":"https://api.github.com/users/wictorChaves/followers","following_url":"https://api.github.com/users/wictorChaves/following{/other_user}","gists_url":"https://api.github.com/users/wictorChaves/gists{/gist_id}","starred_url":"https://api.github.com/users/wictorChaves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wictorChaves/subscriptions","organizations_url":"https://api.github.com/users/wictorChaves/orgs","repos_url":"https://api.github.com/users/wictorChaves/repos","events_url":"https://api.github.com/users/wictorChaves/events{/privacy}","received_events_url":"https://api.github.com/users/wictorChaves/received_events","type":"User","site_admin":false},"labels":[{"id":287375315,"url":"https://api.github.com/repos/mgp25/Instagram-API/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-11-01T11:35:21Z","updated_at":"2017-11-01T14:08:52Z","closed_at":"2017-11-01T13:24:28Z","author_association":"NONE","body":"These are all the information I have in the \"redirect message\":\r\n\r\n```\r\n\"InstagramAPI\\Push\\Notification::__set_state(array(\r\n   '_json' => '{\"bc\":\"{\\\\\"di\\\\\":1}\",\"a\":\"https://scontent.cdninstagram.com/t51.2885-19/s150x150/22427084_1379006105560427_4701611062963731234_n.jpg\",\"collapse_key\":\"direct_v2_message\",\"badge\":\"1\",\"s\":\"None\",\"u\":6268530506,\"PushNotifID\":\"55cda2f7e256fH175a22f4aH55cda79142841H21\",\"sound\":\"default\",\"pi\":\"55cda2f7e256fH175a22f4aH55cda79142841H21\",\"it\":\"wictor.123sent you a message.\",\"m\":\"wictor.123 sent you a message.\",\"ig\":\"direct_v2?id=340282366841710300949128174077142300032&x=27844775177168837278020018917867520\"}',\r\n   '_title' => NULL,\r\n   '_message' => 'wictor.123 sent you a message.',\r\n   '_tickerText' => NULL,\r\n   '_igAction' => 'direct_v2?id=340282366841710300949128174077142300032&x=27844775177168837278020018917867520',\r\n   '_igActionOverride' => NULL,\r\n   '_optionalImage' => NULL,\r\n   '_optionalAvatarUrl' => 'https://scontent.cdninstagram.com/t51.2885-19/s150x150/22427084_1379006105560427_4701611062963732480_n.jpg',\r\n   '_collapseKey' => 'direct_v2_message',\r\n   '_sound' => 'default',\r\n   '_pushId' => '55cda2f7e256fH175a22f4aH55cda79142841H21',\r\n   '_pushCategory' => NULL,\r\n   '_intendedRecipientUserId' => '6268530506',\r\n   '_sourceUserId' => 'None',\r\n   '_badgeCount' =>\r\n  InstagramAPI\\Push\\Payload\\BadgeCount::__set_state(array(\r\n     '_json' => '{\"di\":1}',\r\n     '_direct' => 1,\r\n     '_ds' => NULL,\r\n     '_activities' => NULL,\r\n  )),\r\n   '_inAppActors' => NULL,\r\n   '_actionPath' => 'direct_v2',\r\n   '_actionParams' =>\r\n  array (\r\n    'id' => '340282366841710300949128174077142300032',\r\n    'x' => '27844775177168837278020018917867520',\r\n  ),\r\n))Thread ID: 340282366841710300949128174077142300032. Thread item ID: 27844775177168837278020018917867520.\r\n```\r\n\r\nI tried this:\r\n\r\n> var_export($ig->media->getInfo($push->getActionParam('id')));\r\n\r\n```\r\n$loop = \\React\\EventLoop\\Factory::create();\r\n$push = new \\InstagramAPI\\Push($loop, $ig, NULL);\r\n$push->on('incoming', function (\\InstagramAPI\\Push\\Notification $push) use ($ig){\r\n    printf('\"%s:%s\"', \r\n            $push->getMessage(),\r\n            PHP_EOL);\r\n    echo \"aqui: \";\r\n    \r\n    var_export($ig->media->getInfo($push->getActionParam('id')));\r\n});\r\n$push->on('like', function (\\InstagramAPI\\Push\\Notification $push) {\r\n    printf('Media ID: %s%s', $push->getActionParam('id'), PHP_EOL);\r\n});\r\n$push->on('comment', function (\\InstagramAPI\\Push\\Notification $push) {\r\n    printf(\r\n        'Media ID: %s. Comment ID: %s.%s',\r\n        $push->getActionParam('id'),\r\n        $push->getActionParam('forced_preview_comment_id'),\r\n        $push->getActionParam('message'),\r\n        PHP_EOL\r\n    );\r\n});\r\n$push->on('direct_v2_message', function (\\InstagramAPI\\Push\\Notification $push) {\r\n    printf(\r\n        'Thread ID: %s. Thread item ID: %s.%s',\r\n        $push->getActionParam('id'),\r\n        $push->getActionParam('x'),\r\n        PHP_EOL\r\n    );\r\n});\r\n$push->on('error', function (\\Exception $e) use ($push, $loop) {\r\n    printf('[!!!] Got fatal error from FBNS: %s%s', $e->getMessage(), PHP_EOL);\r\n    $push->stop();\r\n    $loop->stop();\r\n});\r\n$push->start();\r\n\r\n$loop->run();\r\n```\r\n\r\nBut it has this error:\r\n\r\n> Fatal error: Uncaught exception 'InstagramAPI\\Exception\\EmptyResponseException' with message 'No response from server. Either a connection or configuration error.' in C:\\wamp64\\www\\Instagram\\vendor\\mgp25\\instagram-php\\src\\Client.php:539\r\n> Stack trace:\r\n> #0 C:\\wamp64\\www\\Instagram\\vendor\\mgp25\\instagram-php\\src\\Request.php(705): InstagramAPI\\Client->getMappedResponseObject(Object(InstagramAPI\\Response\\MediaInfoResponse), NULL, Object(GuzzleHttp\\Psr7\\Response))\r\n> #1 C:\\wamp64\\www\\Instagram\\vendor\\mgp25\\instagram-php\\src\\Request\\Media.php(34): InstagramAPI\\Request->getResponse(Object(InstagramAPI\\Response\\MediaInfoResponse))\r\n> #2 C:\\wamp64\\www\\Instagram\\vendor\\mgp25\\instagram-php\\examples\\testeRedirect.php(24): InstagramAPI\\Request\\Media->getInfo('340282366841710...')\r\n> #3 [internal function]: {closure}(Object(InstagramAPI\\Push\\Notification))\r\n> #4 C:\\wamp64\\www\\Instagram\\vendor\\evenement\\evenement\\src\\Evenement\\EventEmitterTrait.php(70): call_user_func_array(Object(Closure), Array)\r\n> #5 C:\\wamp64\\www\\Instagram\\vendor\\mgp25\\instagram-php\\s in C:\\wamp64\\www\\Instagram\\vendor\\mgp25\\instagram-php\\src\\Client.php on line 539"},"comment":{"url":"https://api.github.com/repos/mgp25/Instagram-API/issues/comments/341116390","html_url":"https://github.com/mgp25/Instagram-API/issues/1670#issuecomment-341116390","issue_url":"https://api.github.com/repos/mgp25/Instagram-API/issues/1670","id":341116390,"user":{"login":"SteveJobzniak","id":22373193,"avatar_url":"https://avatars3.githubusercontent.com/u/22373193?v=4","gravatar_id":"","url":"https://api.github.com/users/SteveJobzniak","html_url":"https://github.com/SteveJobzniak","followers_url":"https://api.github.com/users/SteveJobzniak/followers","following_url":"https://api.github.com/users/SteveJobzniak/following{/other_user}","gists_url":"https://api.github.com/users/SteveJobzniak/gists{/gist_id}","starred_url":"https://api.github.com/users/SteveJobzniak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteveJobzniak/subscriptions","organizations_url":"https://api.github.com/users/SteveJobzniak/orgs","repos_url":"https://api.github.com/users/SteveJobzniak/repos","events_url":"https://api.github.com/users/SteveJobzniak/events{/privacy}","received_events_url":"https://api.github.com/users/SteveJobzniak/received_events","type":"User","site_admin":false},"created_at":"2017-11-01T14:08:52Z","updated_at":"2017-11-01T14:08:52Z","author_association":"COLLABORATOR","body":"@wictorChaves I have no idea. Maybe you load the thread too fast before it has updated on the server. What happens if you `getVisualThread` now? Does it have the new item?"}}
{"actor":{"display_login":"SteveJobzniak"}}