UPDATES EasyBlog 6.0.14 Released! Joomla 5.x and PHP 8.x compatible now!

Helpdesk

Your Time
Our Time
Response Time
24 — 48 hours
We strive to provide the fastest ever response possible. However, we are not super beings.

Allow at least 24 — 48 hours
  Support is offline
Our team is away during the weekend. Some answers may already be available on our documentation

Rest assured that we will get back to your posts as soon as the week starts!
  Support is offline

EasyBlog integration with Mobile App using COM_API

Prakash Reddy · ·
4:07 PM Friday, 04 March 2016
None
Hi Team

After attending JWC15 Bangalore session, we started using Ionic framework/Cardova to build our mobile app for doctors as part of our product offerings to Healthcare.
It has EasyBlog post creation as one of the feature from mobile.
We could able to write a blog with camera integrated and post to Joomla backend.

Now I want to auto post newly posted blog to the user's social channels(FB/Twitter). I'm using EasyBlog API to save blog from mobile.
If I create a blog from Joomla frontend then it started doing auto post.

I'm using Easyblog API plugin offered by Parth (TechJoomla guys) and trying to integrate blog post to Auto post from mobile the way we've done for Joomla frontend.

It looks like the API's content generation events are not as per Easyblog's.
Can you please help me in understanding what needs to be done to get auto post triggered.

For reference, I'm including Blog Post API function, it uses EasyBlog's model to post the content:
public function post() {
$input = JFactory::getApplication()->input;
$blog = EasyBlogHelper::table( 'Blog' );
$data = $input->post->getArray(array());
$log_user = $this->plugin->get('user')->id;
...
$post = EB::post(NULL);
$post->create();
$key = 'post:'.$post->id;

$data['image'] = '';
if($file['name'])
{
$image_obj = $this->uploadImage($key);
$data['image'] = $image_obj->media->uri;
}
//document needs to get from app
$data['content'] = $input->get('content', '', 'raw');
$data['document'] = null;
$data['published'] = $input->get('published', 1, 'INT');
$data['created_by'] = $log_user;
$uid = $post->uid;
// Load up the post library
$post = EB::post($uid);
$post->bind($data, array());
// Default options
$options = array();
// check if this is a 'Apply' action or not.
$isApply = $input->post->get('isapply', false, 'bool');
// For autosave requests we do not want to run validation on it.
$autosave = $input->post->get('autosave', false, 'bool');
if ($autosave) {
$options['validateData'] = false;
}
// Save post
try {
$post->save($options);
} catch(EasyBlogException $exception) {
$this->plugin->setResponse( $this->getErrorResponse(404, $blog->getError()) );
return;
}
$bpost = EB::post($post->id);
// $post->bind($row);
$item = EB::formatter('entry', $bpost);
$scm_obj = new EasyBlogSimpleSchema_plg();
$item = $scm_obj->mapPost($item, '<p><br>
<a><blockquote><strong><h2><h3><em><ul><ol><li><iframe>');

$this->plugin->setResponse( $item );
}

Thanks
Prakash
The replies under this section are restricted to logged in users or users with an active subscription with us