sending info when the user is typing(chatting)? - php

i was wondering how could you implement or the logic if you like, sending the other user that the person thier chatting to is typing something, i know it something to do the chat textfield being empty or not! but i just wanted to kind of clarify! thanks
p.s. im trying to do this on an iphone app and using a php lanaguage when communicating with an api!! thanks

NSNotificationCenter should help you out on this. Read up on that and notifications. You would be able to detect keyboard events using that and hence work your logic out based on that.

Check out this question on detecting the change event for an NSTextField.

Related

Developing REST API using PHP

I am new in API. I am supposed to develop an API that allows our content provider to give information pertaining soccer whereby he is supposed to create matches,update matches etc .I would like to know how to create a REST API in php that allows a client to enter the information. So far,I have created an API but I dont know how to enable the client enter the information.
Informations:
It is the basic form that you have to create and then you must allow the user to submit the form datas that he/she has filled and you have to post the data to the route that you have created.
You must submit the data and then you have to make the submitted data to be json_encode() so that it will work for the API.
Or Else if you are not designing the form and other such things you can directly go in for the API ADD ONS that the Firefox and the chrome has . Assuming you are using the chrome or Firefox as browsers.
https://addons.mozilla.org/en-US/firefox/addon/restclient/
https://addons.mozilla.org/en-US/firefox/addon/rest-easy/
https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en
Okay, assuming that you created a REST API already, download the Advanced REST client chrome extension: https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo
I hope that answers to your question.
P.S: May I know what framework did you use to design your REST API ? Additional details can help you further.
Building REST APIs is atually a rather easy task. That's primarily what I work on at work all day. If you have to use PHP (I'm a fan of PHP, so don't take that comment the wrong way :) ), I would reccommend using a framework like Laravel.
The logic to handle the information once it's requested wouldn't change. You would just need to make your requests/responses REST compliant.
Here is a great tutorial for doing just that!
Also, since you use Yii, this tutorial is probably better. I've never used Yii, so I can't really vouch for it, though.

Android - PHP services to show message to users

I am using php services to show message to user. It works fine but on every refresh it show 3 dialog boxes messages where I am only refreshing once.
How to prevent that, Is that php bug or android? Any idea will do thanks.
Regards,
If I understood your problem then the problem in your android code.
Can you post the code and service response sample if possible so that it would be easier to understand the problem.

Store Facebook data in MySQL

I have a front end page created and want to give a signup option to the user using Facebook. For that I've gone through the registration plugin of Facebook. I know the basics of SQL but don't know how to proceed so as to store the data of the user who sign up using Facebook.
How should I proceed about learning it.
Thanks in advance.
Lynda: (or similar) might fill in some of the web programming basics for you.

can i retrieve visitor's facebook friends when he likes my site?

i have been googling since morning for an answer that meets what i need but with no luck.
i included a facebook like button to a website i am working on, but i was wondering that after a user presses the button,signs in and like the site, is there a way i can use to retrieve a list of this user's friends on facebook? and post something on their walls instantly? not just post the like on his wall.
Or if that wasn't possible, can i retrieve his friends into a csv file or something so i can later send them emails for example ? ..
what i have in mind is like how certain applications ask us for permission to access personal data in facebook and use them in thing releted to them. well same point ! so can this be done ? and if yes, how ??
if you find any links related to this or have previous experience in this domain please post an answer :)
for programming solutions, i use php, yet i am still a junior developer :).
thanx in advance
No, it isn't possible.
Bob liking you does not give you permission to spam all of Bob's friends.
No, you can't get the information you want with a simple Like button.
You would have to create an App, ask for permissions and get the user to agree.
Here is the list of permissions you can ask for.
To build your App, start here.

Alternative log in & authentication methods (for elderly people)

I'm designing a simple web app for some elderly family members, 1 of whom has Alzheimer's. The end goal is to provide them each with a tablet (probably Android but irrelevant for this problem) that would be stripped down to ideally 1 bookmark on the home screen which opens my web app.
What I am looking for are ideas on how to identify the user without the conventional username/password methods. With their condition I know that remembering an username is going to be almost impossible, let alone a password. Ideally I would recognize the device and relate that to a specific user.
There will be other users on the app that access it through normal methods (username+password on PC/mobile/tablet), which I'm handling with Zend_Auth. It's just these 2 users who I am concerned about identifying.
Security isn't a huge concern as the data will not be sensitive in any way, but I still need to differentiate between users.
I am building this in php with Zend Framework. I'm really looking for more ideas than specific code, although anything based in php or javascript would be great. Any ideas or suggestions would be greatly appreciated. Thanks for your help
These advice are only valuable if security is not an issue :
On the bookmarks page, insert a token in the link, which you will use to authenticate the users.
if you can, check in the background for IP/user agent (if there is only one device that needs this simplified auth process, and assuming it's connection uses a fixed IP address)
And a simple idea if you have multiple users using the same device :
on your bookmark page, put a picture of each user
make it clickable, with the token discussed above in the href of the link.
That's simple to implement and easy to remember.
Hope that helps !

Categories