Both, alas. Joomla SEF and my own .htaccess rewriting. So my solution was to add a new field in parallel with the URL and call it $displayURL. I pass in non-SEF URLs for all real work, but then give the display URL to Facebook. It works. I made it default to null, and use the original URL if not set, maintaining backwards compatibility with your plugins.
But no third party SEF. Just Joomla's, and almost everything has a menu item with alias.