Creating Chat function in iOS - Through continuous request - objective-c

I was tasked to create a Chat function for our app in iOS. I found this tutorial which creates a Chat app from scratch.
http://www.ibm.com/developerworks/library/x-ioschat/index.html
The link above is very helpful, but there is a small problem. In the app, a request will be made every 5 seconds to look for new responses. One of my colleagues said that it is not advisable to make a request to the server every now and then.
So I decided to look for other alternatives. I learned about long-polling through this link.
From what I understood, once a request was made the server will "hold" the request until something interesting comes up. Does this mean that once a response was thrown to the user, the request ends? If that's true, this means that a request will be made every now and then as well, right?
If that's the case, can anyone tell me what's the best way to implement a chat function in iOS?
My friend showed me a AJAX JavaScript code (I just found out that he also used a plug-in, which I am not familiar with) where a single continuous request was made, and this request doesn't end even if a response was already thrown to the user. Is there a way to do this in iOS?

It is not a good approach to make http ajax request to send and receive chat. A chat response should be displayed at the moment when the other user press "Send". We cant ask for the users to wait 1 second to fetch if there any new responses.
You must use a chat server to accomplish this. I hope the following url would be helpful. I just wanted to give you the Idea of using a Chat Server.
http://wiki.remobjects.com/wiki/SuperHTTP_Chat_(iOS)Sample(Xcode)

Related

how to make Flutter ValueListenableBuilder to update the ui every time the the app request data from the server

Im new to flutter and was wondering if there is any example codes explaining how to preform live updates to the ui each time the rest api get is called. i want the builder to listen to a predefine variable that will be changed every time the api data as been requested. I wanted to try stream builder but i dont want to spam request from the server. If any one have any advice or method to preforming this task please kindly explain, If you have any example codes on the exact thing please share . thank you

Intercept data from post request with api platform

It's my first post here: after hours of research on web I decided to ask here if someone have the answer.
-> I m working on a symfony app and I have just started using api platform and would like to know if it is possible (I guess so) to "intercept" post requests to process their content. I would like to be able to compare the contents of a table with the contents of the query. The final goal is to be able to authenticate devices if their activation code is in the table in question.
Hope this is understandable ...
Thank you in advance :)
Yes, it’s possible Api platform have some events and you can listen one of them see https://api-platform.com/docs/core/events/
In your case I will listen POST_DESERIALIZE

direct message sync issue with twitter API

I am using the twitter api to get all direct messages
while testing I tried to delete a message from the twitter website and then tried to reload my app's direct message page (get via api) - the dm I deleted was still showing in my app but it wasn't on the account I was using on the website.
I'm not sure whats going on here, any help is appreciated
You usually should give a second after an update/delete operation on Twitter. If you do, I would say that something is going wrong with your code.

PushWoosh remote API createMessage limit

Does anyone know how many notifications we can create at once using PushWoosh's remote API ?
I'm talking about this method :
http://www.pushwoosh.com/programming-push-notification/pushwoosh-push-notification-remote-api/#PushserviceAPI-Method-messages-create
Is there any limit in the "notifications" array?
I assume there must be one, but didn't find any information about it on the guides.
Thanks.
Answer : I did some testing using the Remote API, and i couldn't get a response when sending 1000 push at a time.
However, when sending 100 push, it works fine.
I would suggest sending no more than 100 (that's what i will do).
Though it is possible to include several notifications in one call, I would recommend using one API call per notification. This way you can track each notification status.
Pushwoosh team :)

Do any Google Voice APIs still work?

I am interested in writing a simple CLI program that will send an SMS using Google Voice.
There are several scripts and an API or two available, but I have run into an issue that none of them seem to work any longer; as they mostly rely on parsing returned web pages.
Is anyone familiar with a current API that works so that I can send an SMS on Google Voice?
Thanks!
Looks like Google Voice changed the login procedure, and it now expects you to pass back a cookie. This issue for the Python wrapper sums it up: http://code.google.com/p/pygooglevoice/issues/detail?id=60
UPDATE AND FIX: Actually all that needs to happen is to change the login URL in your code:
Old URL - https://www.google.com/accounts/ServiceLoginAuth?service=grandcentral
New URL - https://accounts.google.com/ServiceLogin?service=grandcentral