Ionic and socket.io for real-time data update

Hi everyone.

I was wondering if anyone has an example on how to connect socket.io to Wordpress using ionic as framework?

I am making an app which will need to have real-time data update and I believe that the best way to do so is by using socket.io. Data that needs to be shown in app will be created in Wordpress and will be shown in app with WP REST API.

Does anyone have an idea on some other approach for this?

All the examples that I found so far need to use node.js

Thanks in advance!

I think there is no way to use socket.io with WordPress.

Perhaps you can build a node js backend and WordPress can call this nodejs backend when new content is created.

Then your nodejs backend can tell your ionic app that new content is available with socket.io and your ionic app can use the WordPress rest api to show the new content.

:thinking:

Thank you for your reply, that sounds like a solid idea.

Do you maybe have another solution on how to update data with the REST API, that doesn’t involve calling http get request in some interval?

Thanks!

Sorry no other idea…

Maybe I can connect Wordpress to socket.io following this tutorial?

Looks like they use a second nodejs server in this tutorial.