location_id for Facebook event creation -
i trying use location_id , retrieved current location, parameter facebook event creation, here code:
i have set authorization token , extended permission , , indeed returned valid location id; however, after plug location_id event creation parameter array, did not create event. (all other fields set through form).could help?
here code:
try{ //default location $event_url = $my_url . 'create_group.php'; $event_location = $facebook->api('/me?fields=location'); $event_location_id = $event_location['id']; echo $event_location_id; } catch(exception $e) { echo $e; } $params= array( "name" => "[study group]".$_post['name'], "description" => $_post['description'], "location_id" => $event_location_id, "start_time" => $_post['start_time'].$_post['time_zone'], "privacy_type" => $_post['privacy_type'], "end_time" => $_post['end_time'].$_post['time_zone'] ); here exception have:
exception: place or event attempted plan attend invalid. please try different place or event. the exception solved in following way: change:
$event_location_id = $event_location['id']; to
$event_location_id= $event_location['location']['id'];
the exception tells error wrong value of location id. , have debugged because of retrieved as
$event_location_id = $event_location['id']; which should instead retrieved
$event_location_id= $event_location['location']['id'];
Comments
Post a Comment