Is it possible to send chat invitations using XMPPHP?
I have successfully setup the messaging system from a CMS, but I am looking for a way to send chat request before the first message is sent.
Is it possible to do that in XMPPHP? I am asking this because I could not find any proper documentation for the class. Thank you for any input.
you can use below for send chat invitation.
$conn->subscribe('$jid');
by
$conn->unsubscribe('$jid');
you can remove jid from your contact list
Typically in XMPP, we don't send a request first, we just send the first message. If you MUST have this feature, you'll want the protocol from XEP-155 (Stanza Session Negotiation). You'll likely need to implement this protocol yourself, and also deal with the case where the client on the other side doesn't implement the protocol... mostly because NOBODY has implemented this. :)
Related
We have firebase chat application (check any chat example or tutorial) that will have same copy as our.
We would like to sent email notification or sms message, if user hasn't seen the chat message yet.
We can connect to firebase database with php and check all the messages, if they are seen or not. but It's not really proper way of doing it.
Does anyone have idea how we can implement that, so we can track of all the messages and if they haven't seen it, then sent the email / sms notification based on user preference?
I just want to know how we can do that with firebase. if it was just php and mysql. it was really easy to do this.
Not sure if this can be done efficiently in Firebase. You will have to setup a cron job to fetch the messages which are not seen and trigger SMS/Email fallback.
I would recommend using Applozic (https://www.applozic.com) for Chat related stuff and Firebase for storing user meta data and other data.
Applozic provides a single click configuration to enable Webhook/SMS/Email fallback, along with that you will get all the whatsapp like chat features along with full UI with no need to write any additional code.
I'm trying to implement push notification but I'm a little bit lost.
I just want to have a button in php and when I click it, a notification appear in all devices telling the users something like: "A new image is available in the web".
I read the GCM documentation but I'm not sure how to start.
I see that in some examples the users have to send their emails in order to register their "sender id"? it is necessary? I want the user don't have to register anywhere.
Can someone help me to start or give me a quick tutorial?
Thank's for all.
You will need to use curl to call the GCM, you can find examples like this all over SO, for example : how to send a notification to millions of android devices in php using GCM (first one that came up in a search)
And of course you will need the registration id's otherwise GCM doesznt know which device to send the notification to.
The solution is not so simple. You should at least use some package dedicated to this specific service. Also, you should read something about what push notifications are.
There are many services out there you can use to interface yourself with this specific kind of service.
Take a look to this service to get a first idea about the entire mechanism. Remember that you have to subscribe to a push service provider for every platform you want to use. For example the Apple Push Notification Service, or Cloud Messaging by Google.
Hope it's a good start for you.
I am stuck in a situation in which when a user registers, he/she get a confirmation SMS on his/her mobile number, and he/she able to confirm their application by replying to the confirmation SMS, be repling like YES/NO to that confirmation sms..
Is there any SMS gateway available which provides the suitable functionality, I mean an API which takes user input from sms reply..
thanks in advance
Twilio has the ability to receive sms messages.
https://www.twilio.com/docs/quickstart/php/sms
There is a definite solution available for this. Try exploring with FrontLine SMS that offers a similar functionality, though you will have to then use a 10 digit registered number to send your confirmation SMS.
How to use frontline sms:
Get an internet dongle from a cellular company (Idea, Airtel,etc)
connect dongle to PC
install frontline SMS
Frontline SMS detects dongle.
Frontline SMS API's available to read incoming SMS on dongle and forward to your server with POST/GET methods.
Try it out & let me know it work.
Regards,
Mihir.
PS: i use Huawei dongle + idea connection.
You can use mVaayoo (http://www.mvaayoo.com/sms-gateway-features-benefits.html)
It supports Easy 2-Way SMS Integration with Website, ERP, CRM or any application.
They will provide the rich documentation which helps you to solve your problem.
You can go to that site and register and test it..
There are so many things in the documentation like return values by getting the return values.
You can use http://routesms.com/
This is easy to use and cheap. I used it for like 3 years. They have all types of API with documentation.
The answer is Yes, try Clickatell, they also support India.
Please note that this is copied answer from another question...original This question is a duplicate.
Expensive, but it is possible.
I am trying to implement a chat application in IOS. In general We use two php files one for posting a message(sender) another for retrieving the message(receiver).
I want to accomplish the following:
Consider A(sender) and B (Receiver).
A sent message to B. And A is waiting for B's reply. So i need to call post-api.php for sending a message and at the receivers side(B) i need to retrieve using getapi.php
when B reply to A it must automatically appear in my inbox(live chatbox) of A, without calling getapi.php. I know this scenario is not possible. But is there any solution or method so that my chat application works like skype or facebookchat.
There is multiple way to implement the chat functionality.
Polling: Send request to server and process the response from the server in timely fashion after a particular time interval using NSTimer(But remember is will cause the battery drain).
Using APNS: Using the official Apple push notification implementation, whenever there is new entry in chat table on server side send the notification to particular device using push notification and handle the notification using the delegate methods (Although not 100% reliable).Using Push Notification
Using Socket Programming: Using the socket programming you can have dedicated connection between client(device) and server. I have provided the link having the source at the end of the tutorial.Using Socket Programming
As you know that without getapi.php it is not possible to update chat list so you need to make management something like: you need to use NSTimer and with the help of timer you need to call your getapi.php service after certain time interval let say after 2min so that chat can be refresh and user get the reply this is the only possible way at my knowledge.
I want to add an additional functionality to a CMS I am making that will allow users to add content to a site via text message. The user should be able to upload an image and add text and send the message to a number which when received will update the database accordingly.
Can this be done, and can it be done via PHP because that's the only language I know? Also what would be the general outline to achieve such a thing?
You have to find a SMS gateway that supports "incoming" of SMS. Click-a-tell is generally the one people choose because of their API and documentation, they aren't free though. If you do a quick Google search for "SMS Gateway" you'll find plenty of other solutions.
Once you choose the gateway you want to go with, the rest of the process is easy. You would just handle the SMS as a regular request into your application.
Hope that helps you get started!
Use one of the many SMS gateways out there like Twilio (whom I work for, but loved before I was an employee) which has a really simple API and great documentation. There are tons of PHP examples. When you receive a message, a simple POST request is made to a URL you specify with parameters for To, From and Body. Also if you return text from the URLs you use to receive messages you can respond back to them. You can also initiate outbound SMS from the same number using the REST API.
Twilio does not currently support MMS (needed for your image uploading requirement) and is not free, but you only pay for what you use at $.01 per message.
Completing the answer by Raphael Caixeta, I recommend that you use the standalone PHP binary to run a pre-determined script, which parameters you'll get from the SMS/MMS. This way you can separate the two process:
1) Make a script and test it by running it through the command line.
2) Implement the SMS/MMS receiver software so that it parses the messages and runs the first script with custom parameters.
You can use a GSM/3G modem (or dongle) to receive SMS messages. And this sms software can read those messages from the modem in real time and put them automatically in your database.