File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -381,6 +381,8 @@ private function extractPageInsightsMetricsFromResponse($response)
381381 foreach ($ metricValuesByDay as $ key => $ value ) {
382382 if (isset ($ value ["end_time " ]) && isset ($ value ["value " ])) {
383383 $ result [$ metricName ][$ value ["end_time " ]] = $ value ["value " ];
384+ } else if (isset ($ value ["value " ])) {
385+ $ result [$ metricName ] = $ value ["value " ];
384386 }
385387 }
386388 }
@@ -482,13 +484,13 @@ public function subscribeToWebhook($pageId)
482484 // which currently does not support Instagram webhooks fields
483485 // as a workaround we are subscribing to the email fields, to get the webhooks up and running
484486 // so that it will return story_insights events
485- $ params = ["subscribed_fields " => 'email ' ];
486- return $ this ->sendRequest ("POST " , "/ $ { pageId}/subscribed_apps " , $ params )->getDecodedBody ();
487+ $ params = ["subscribed_fields " => 'email ' ];
488+ return $ this ->sendRequest ("POST " , "/ { $ pageId }/subscribed_apps " , $ params )->getDecodedBody ();
487489 }
488490
489491 public function unsubscribeFromWebhook ($ pageId )
490492 {
491- return $ this ->sendRequest ("DELETE " , "/ $ { pageId}/subscribed_apps " )->getDecodedBody ();
493+ return $ this ->sendRequest ("DELETE " , "/ { $ pageId }/subscribed_apps " )->getDecodedBody ();
492494 }
493495
494496 public function getMe ()
You can’t perform that action at this time.
0 commit comments