Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is whatsapp fetching message in background in windows phone?

After the latest update of Whatsapp on Widows Phone Store, I have noticed that now, once they show the toast of message on my device, then they mark the message as delivered (notify the sender that the message has reached my device).

After I let the toast notification go away, I switched off all my data connection and opened Whatsapp and found that that particular message in my app. This is happening consistently on both wp7 and wp8 device. This was happening even when I had disabled background agent! Beside background agent of an app does not run all the time.

So my questions is, on windows phone platform, where the app is not allowed to run in background all the time, how is Whatsapp application getting those messages? Is it using any particular api/hack to get(in app) those messages when it's not on foreground.

like image 857
ua741 Avatar asked Dec 11 '25 08:12

ua741


1 Answers

The question you have asked has two parts: one for wp7 and the other for wp8. I will anser each one by one.

Windows phone 7

Based on my research, I have found that whatsapp is still using audio streaming api on wp7 devices to stream messages in the background i.e. when the app is not running. Whatsapp was criticized of using this API as constantly using this causes battery drainage as well as hampers the music experience of the user.

Windows Phone 8

Once whatsapp moved to wp8 they stopped using the Audio API and moved to VOIP API. Note that whatsapp doesn't use VOIP for any purpose but their manifest shows usage of VOIP api, and after reading many articles I have come to the conclusion that they are using this API to activate background agent and pool messages in the background.

While sending raw push of type 4, the background agent for VOIP is activated in which you can practically do anything from reading the payload to establishing a new socket connection subjected to restriction on usage of certain APIs

I have also found out that even if a user disables bg agents for an app some essential bg agent still continue to run for eg bg agents in audio stream API and VOIP API.

I hope this answers your question.

like image 58
Milan Aggarwal Avatar answered Dec 13 '25 12:12

Milan Aggarwal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!