How to post to Facebook with location attached using JavaScript SDK -
i trying post user's facebook wall using javascript sdk phonegap mobile app. able post message user's wall app. want attach location post looks checkin. facebook checkin working fine, since deprecated, want use post suggested facebook.
below code:
fb.api('/me/feed', 'post', { name: 'somename', message: 'somemessage', place: { 'id': pageid, 'name': name, 'location': { 'latitude': latitude, 'longitude': longitude } } }, function (response) { if(response){ alert("post published!"); } else { alert("post not published. try again.") } });
the place tag needs id, name , location latitude , longitude, provided them above. alert message saying post published!, isn't posted user's wall. if take out place field, works fine.
thanks in advance.
set place location id. example worked searched solution application:
fb.api('/me/feed', 'post', { name: 'somename', message: 'somemessage', place: '106039436102339' // id tallinn, estonia }, function (response) {});
Comments
Post a Comment