Push events to a native page?

1
Hi guys! I am building a native app in mendix and I have a problem with data refresh on a native page. I would like to push an event to a native page. I would like to show another page when an enumeration value is changed by a microflow. The pusher available in the app store fixes a similar problem in non-native apps. Currently I am using a nanoflow that has an infinite loop to check whether the enumeration value (status) changed. This infinite loop however causes the battery of the user to go empty fast. Anyone has a suggestion on how to fix this issue? 
asked
2 answers
2

Socket.io might come to the resque:

https://austinmcnicholas.com/blog/2019/7/23/socketio-mendix-implementation

answered
0

Thanks for your answer Tim. 

We tried to implement your suggested solution but we are stuck on some point, maybe someone can help us (I also posted it under the original artical):

I got the feather server up and running, and after I commit an object and call the REST service my node JS console shows:

'Publishing all events to all authenticated users. See channels.js and https://docs.feathersjs.com/api/channels.html for more information.

I can also see that a new record is created in the database.

However, somehow the widget doesn't run the code where it listens for the create events. In other words; this line of code is never run:

log.call(this, 'socket received something: ' + message, this._WIDGET_VERSION);

Do you have any idea where it is going wrong? I'm viewing the same object in two browsers, and edit the one. The console shows that both browsers have en open socket connection.

Thanks in advance!

answered