Topic-icon Automatic posting on facebook doesn't work in 5.0?

Active Subscriptions:

None
Hello,

For a time we used following code in our components (hardcoded) but since 5.0 it generates an error, (something to do with $jfbcLibrary->getUserId()).
How can we solve this error because this is working absolute fine for us...

require_once JPATH_ROOT.DS.'components'.DS.'com_jfbconnect'.DS.'libraries'.DS.'facebook.php';

$jfbcLibrary = JFBConnectFacebookLibrary::getInstance();
$post = 'name';
$post = 'name';
$post = 'name';
$post = 'name';
$post = 'name';
$post = 'name';

if ($jfbcLibrary->getUserId()) // Check if there is a Facebook user logged in
$jfbcLibrary->setFacebookMessage($post);
The topic has been locked.
Support Specialist
13 years 3 months ago #31544 by alzander
The getUserId function was removed in the 5.0 release because it was a confusing function. It's been replaced by:
$jfbcLibrary->getMappedFbUserId()

Just update that, and your code should be fine.

One final note, in JFBConnect, we no longer will ask for the publish_stream permission from users, even if you have a "Post to wall on Register" or "Post to wall on Login" message set. You'll need to go into the Facebook API tab of configuration and add "publish_stream" as a requested permission if you want to post on their wall like you're doing above. All past users who have already granted the permission won't be affected. That setting will just make sure new users are properly giving that permission.

The reason for the change was an update to Facebook's policies that messages shouldn't be posted on a user's behalf without them being able to edit and/or approve the message first. If your users are aware of the message, that's fine. If they aren't, you *could* be falling afoul of their terms of service. We haven't heard of any apps being banned for doing such things, but wanted to let you know about that change.

Hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
13 years 3 months ago #31546 by maxmedia
Hello Alzander,

Thanks for replying so fast, I will try this today.
publish_stream is enabled, we know that and also we now that it could not be what Facebook likes.

I will let You know if this is working...
edit: work like a charm :) thank You again.
The topic has been locked.
Support Specialist
13 years 3 months ago #31551 by alzander
No problem. Glad we could help. If you need anything else, just let us know.

Finally, if you haven't already, please consider leaving a rating and review for JFBConnect, or our support, on the Joomla Extension Directory. It certainly isn't required, but is very appreciated:
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks,
Alex
The topic has been locked.