Facebook chat API - XMPP typing paused notifications - facebook

I'm using the XMPP protocol in order to send and receive messages with the Facebook chat.
I'm able to receive messages, and as well get the typing notifications.
My problem is that I'm not receiving the 'typing paused' notification.
My app has successfully made the auth procedure and when the user is typing a message I'm receiving the 'composing' message but when he stops typing I'm not getting the 'paused' message that is documented in the XEP-0085 protocol.
Thanks

The answer is most likely that Facebook doesn't support <paused/>. Only support for <active/> and <composing/> is absolutely required by the XEP.
Your client should handle <paused/> appropriately, but also handle not receiving it just fine too.

Related

How to receive message stanza without sending self presence?

I am using mongooseim with Android and Ios application. I just want to receive message from the server from background without sending self presence to anyone because this task is done by system. But I can't receive message stanza until I send my presence to the mongooseIM.
Do I missing something or there is a way by which I can get quick update from MongooseIM server in the background without sending presence?
As far as I understand you all you want to do is sync the messages when you receive a Push Notification. MongooseIM can be configured to serve a simple HTTP API with which you can get archived messages (mod_mam needs to be enabled) without establishing the XMPP connection. More details can be found in the HTTP API doc, especially the Swagger doc regarding get messages. Let me know if this suites you.

Ejabberd Message delivery while application is terminated

I am developing a chat app using ejabberd server for both IOS and Android. I also wrote a module for ejabberd to get the offline messages sent to my own server api .
my own server api will send notifications to the IOS/Android platforms using FCM.
On the client side , if the application is in the foreground or the background , it will stay connected to ejabberd and if the client receives the message then ejabberd will send the message delivery status.
I am facing an issue while the app is terminated ( service is not running ) which means it is not connected to ejabberd (offline) . if i send a message to this app while it is not terminated , it will receive a notification but the message still undelivered . how can mark the messages as delivered when receiving the notification while the app is terminated.
to explain it more , the same functionality is working fine with whatsapp :
device A has whatsapp installed and whatsapp was turned off (terminated)
Device B has whatsapp running
Device B sends a message to device A
Device A receives a whatsapp notification
Without doing anything on Device A , the message status on Device B is marked as delivered .
How can I implement this scenario with ejabberd ?
In case someone went into this issue , here is the solution that I implemented with help of #Mickaël Rémond from his answer.
I configured ejabberd to send the offline messages to an http service ( your own server) please refer to this link for further on how to do it
your server should catch the above call and generate a notification message (FCM ) in my case and send it to recipient device
recipient device will catch the notification which includes the message
recipient device will call http service (your own server backend)that responsible for sending the deliver ack to the original sender . you need to pass from, to , stanzaId , vhost with this call
backend server will use ejabberd-api (set of exposed apis to manage ejabberd through rest apis calls) to send delivery message using this api
please note the following notes also :
sending the delivery message from your own server to ejabberd will not delete them from ejabberd database
if the user re-connected to the ejabberd server then the recipient will receive the message again from ejabberd .
It is probably too complex for a simple Stack Overflow question, as you need to integrate several moving part on client and server:
You need to execute code in background when receiving push notifications on iOS (you need that property set on your app in your app provisioning profile and have code to handle that). The client will initiate an HTTPS query to let the server know that the message was delivered.
You need to have an endpoint that will get the delivered HTTPS calls and generate either a message ack or a chat marker on behalf of the user and route it in ejabberd.
In real world, this is not enough if you want to take into account the fact that you can only have 1 push in the queue on APNS. If you have several messages sent while the device is not on the network, you will need to have the device check all received messages while offline on the server, otherwise you will lose messaging.
You need to rely on XMPP Message Archive Management (MAM) to handle that history.
As you see, this is not a simple few tens of line of codes but need real design and involved work.

Is it possible to create an app that auto responds to phone calls with a text message, and auto replies to received texts and emails?

I have not been able to find any information about the topic online, so I am assuming it is not possible, but is there a way to create an app that when turned on will respond to all incoming calls by sending them to voicemail and responding with a text message? I know you can set the reply with message in iOS6, but we would want the message to be sent automatically when the call is recieved, currently the respond with message the user still needs to hit a button when the call comes in to send this. We would also want to respond to any incoming SMS/imessages with a text. As well as reply automatically via email to any incoming emails. If anyone could link me to an apple site or somewhere that says you can't do this? Thanks for your help.
Edit - is there any way to get information about notifications for these items? I was thinking if you can't directly handle the call itself, on a timed loop you could check to see if there were any missed calls or any info relating to those? Thanks
Not unless you want to develop and application for jailbroken phones, which will not be allowed in the Apple App Store.

Send text message without show message composer or in bckground in iphone

Hi is it possible to send text message in background..?My new requirement is to send SMS if there is no internet connection .
I am trying MFMessageViewComposer but it shows the pop up view.
How can we send message without shown this pop up? Is there any other way to do this things.
It's not allowed. For example, what if I develop an app which send taxed SMS to a server of mine to get money ? That´s the main reason... I could also send innaproriate or SPAM SMS to random numbers...
That's why the user has to validate the sending.
Send SMS programmatically, without the SMS composer window hope that helps... Looks to be a similar question. According to the poster, ios6 does not allow you to send SMS in the background, without using a 3rd party API, like Nexmo, who provide a REST API to send messages using HTTP.
To send a message using Nexmo, just send a request like http://rest.nexmo.com/sms/json?api_key=n3xm0rocks&api_secret=12ab34cd&from=MyCompany20&to=447525856424&text=hello+hd1 and you'll get back JSON, change the endpoint to xml if you prefer that.

XMPP Framework: Not able to receive my messages

I am working on xmpp framework. I have done most of initial things. I created stream, Connected it and get authenticate. Now I am sending buddy request to another user from my app. App shows presence is sent. When I get roster it shows a entry there. But on other system I am not getting any precence or anything. I tried to send a message message is also not received by other client.
Than I used one id in ichat and send friend request to that id. Wow I am able to see friend request on ichat. I accept request from ichat :( No notification on my app.
If I send message to ichat. Message shown in iChat. but when I send message to my app from ichat.. My app is not getting any delegate called or nothing.
I don't know why this is happening.
I am using a non ARC xmpp framework.
Please guys Please help me. I am badly stucked in it :(
Thanks in Advance.
Have you consider to send presence after get authenticate?
If you are authenticate but not sending preence than server will consider you offline and all messages sent to you will be stored on server with delay.
Send your presence and see the magic. :)
I am not an iPhone developer so i can not explain programming.
In XMPP, Presence subscription has two handshakes. Like When first user send request to second user , it will ask for presence subscription to second user. When second user accept , then first user is subscribed for second user's presence. So he can get all the presence of second user. It's called "to" subscription type for first user. Now second user ask for presence subscription to first user and first accepts request then this "to" subscription type changed to "both" subscription type. Now both user can get presence of each other. otherwise only first user can get presence of second user.
And for messages, there must be a some prob with listener.