File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -381,6 +381,8 @@ private function extractPageInsightsMetricsFromResponse($response)
381
381
foreach ($ metricValuesByDay as $ key => $ value ) {
382
382
if (isset ($ value ["end_time " ]) && isset ($ value ["value " ])) {
383
383
$ result [$ metricName ][$ value ["end_time " ]] = $ value ["value " ];
384
+ } else if (isset ($ value ["value " ])) {
385
+ $ result [$ metricName ] = $ value ["value " ];
384
386
}
385
387
}
386
388
}
@@ -482,13 +484,13 @@ public function subscribeToWebhook($pageId)
482
484
// which currently does not support Instagram webhooks fields
483
485
// as a workaround we are subscribing to the email fields, to get the webhooks up and running
484
486
// 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 ();
487
489
}
488
490
489
491
public function unsubscribeFromWebhook ($ pageId )
490
492
{
491
- return $ this ->sendRequest ("DELETE " , "/ $ { pageId}/subscribed_apps " )->getDecodedBody ();
493
+ return $ this ->sendRequest ("DELETE " , "/ { $ pageId }/subscribed_apps " )->getDecodedBody ();
492
494
}
493
495
494
496
public function getMe ()
You can’t perform that action at this time.
0 commit comments