简体   繁体   中英

C# WP8 instant messaging - how?

For a school project, we have to develop a Windows Phone 8 app that supports instant messaging. However, we are unsure how to accomplish this. We already use WCF web service in our project, eg when users log in to the app (authentication) or register an user.

One way we thought to do 'instant messaging' is to let users send messages via our web service, store the message in a database, and then let the phone app poll the web service every 5 seconds for new messages. If new message, then download the message via web service and display it / make notification.

Could this be an okay way to achieve this? What would be the right thing to do?

Best regards

You should use Push notifications. That's the way to send some info to the phone without it actually asking for that info.

The Microsoft Push Notification Service in Windows Phone is an asynchronous, best-effort service that offers third-party developers a channel to send data to a Windows Phone app from a cloud service in a power-efficient manner.

from Push notifications for Windows Phone

So you'll send the messages to the phone, and your app won't have to ask is there a new message? every couple seconds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM