How to read or detect new data in REST Webservice - iphone

I've created a REST-webservice with cakePHP for my mobile app. And the idea is to allow customers to load new data in to the system. Now the mobile app will have to check if there is new data available in the system. It can do this by asking the webservice which returns json. Now my question is how can i store the customers data so when i query the webservice it shows which data is new so i can use the new data and leave the old ones?

When querying you will need a way to track which data is already loaded. Depending on the type of data, sending or tracking the last update may suffice (to filter by a creation date), as may a "sent" flag per client on the server side.

Related

check weather the user readed data or not in flutter using firestore

I was developing the chat app in flutter using firestore, the users successfully chat one-to-one. but I also want to send the notification to the user that someone sends him/her a message. For that I decided to use the cloud messaging service of firebase, but how can I check that the user read the message or not.
There is nothing built into Cloud Firestore to track which user has read a specific document already.
The two most common approaches that I know of are:
To track for each individual message and each individual user whether they have read it, so by keeping a list of the user IDs in each message document. While this potentially stores a lot of extra data, it is the most direct mapping of your use-case.
In most chat apps though, tracking of what messages each user has read is done as an "up to here". So if the user has read all messages up until a certain one or a certain time, the assumption is that they've also read all the messages before that one/moment.
For this model you can instead just keep a single document ID or timestamp for each user (i.e. readUpTo), instead of having to mark each message for each user that has read it. In your UI, you then determine whether to show each message as unread based on the message ID/timestamp compared to the timestamp of readUpTo.

REST api to allow multiple users edit the same form at the same time

I'm looking to make something similar to google docs where everyone can update the form (with multiple input fields) at the same time using REST api, the form data will be stored in database, is it possible?
I can have the form to send an update request whenever user make a change, but I still can't quite figure out what the logic to retrieve data/update form field content and resolve conflict when users are editing the same field.
Best way to use SignalR for realtime communication as well as pushing the updates to other users belonging to the similar group (may be call it as users of a same form). SignalR will provide all the underline infrastructure in place.

Yii2 notification system implementation

I am trying to implement simple notification system in Yii2.
I have a list of Records populated in ListView.
I would like to allow users to vote for this records. Only once per Record.
Also the Author of each record must be notified (smth like new incoming emails) about who voted for his Record.
What is the easiest way to implement this in Yii2?
Thanks for an advice!
With php only you can't do that, you need to have js at some point.
Solution One could be, from user B side you keep asking the server after certain time (using ajax), if anything(event) happened. If it does return the result with that ajax and update the page.
But then again this is not a very good practice.
If you really want a Real Time update, you might want to use socket.io. Then again using php socket is a bad idea.
So here comes the Solution Two: yii2 + redis + nodejs + socket
redis will do the communication between yii2 and nodejs. The idea is, if anything (event or update) happens yii2 will publish a event with associate data to redis channel and nodejs which is listening to that channel will catch that event and send the data (or update) to client using socket.
Here is a real time chat application tutorial using yii2+redis+nodejs+socket.

Mobile Chat - How to store data?

I'm trying to figure out the best way to store data for a mobile chat program.
Basically I will be able to make a group with my friends and they should also see the same group I made.
I'm assuming the best way is to store the data locally on each phone, and then when someone sends a message, it goes to the network, and the network sends that data to each recipients local phone so that it updates the local data.
That way when people are opening up the application, the previous few messages are still visible, since the program will check local data storage.
Is this the proper way to create mobile chat? Or should there be no local storage of data?
The best way will be to store data locally and on the server as well. The reason are as follows
Local data is for the users and will allow the saving on data costs instead of the users always having to get their chat data online everytime they logon. My assumption is that you want to have offline messages the way that Whatsapp chat client has.
Server data is for your reference and also good practice in order to provide the user with data up to a certain point in history if they have lost their device and they login to another device.
I hope this helps and answers your question.

iOS app - users updating wait time

I am building an iPhone app in which users (or employees) will be able to go to restaurants and update/give an estimate of the waiting time at that location. To do something like this, would it be most efficient to use an XML webpage and parse the data that is currently there and update that value with the user's input then reload the XML database? Obviously any user should be able to update the site so it needs to be done from a web-server.
Also, if anyone knows of a similar example for this, that would be spectacular!
Thanks for your help,
you can take a textfield in which you can fill the value and then send it onto the web server through XML or JSON web service and the other users can see the update from the web service.