How can I attach a file in an Azure communication service chat? - c#

I develop chat application using azure communication service chat. For that I follow https://github.com/Azure-Samples/communication-services-web-chat-hero this example and its work. Now I am try to send attachment in this chat but I am not able to find any salutation.
Is it possible to add attachment?

Currently attaching files to chat messages is not natively supported by the Azure Communication Services JavaScript Chat SDK.
I would recommend filing a feature request here for built-in support: https://github.com/Azure/azure-sdk-for-js/issues/new?assignees=&labels=&template=feature_request.md
Conceptually this is totally possible however, if we take the example of embedding a video inside a chat message:
The web client sending the video would need to first upload the video to a storage space you own. This could be to your server or a third party storage solution such as Azure Blob Storage.
The chat message would need to include a placeholder value that indicates there should be a video file here e.g. Take a look at this video: {{video src=VIDEO_SRC}}.
Web clients receiving chat messages would need to first parse through the message and look for special indicators (in our case this would be {{video src=VIDEO_SRC}}). If one is found, the message would need to be specially constructed to support a video. In this case the message html may end up something like:
<div>
Take a look at this video:
<video src=VIDEO_SRC />
</div>
NOTE: This is just one, trivial implementation of how it could be possible to implement attachments in a chat message. This does not take into account security concerns with allowing attachments to chat messages and validation should be performed on message content before being placed into a chat message.

Related

sending push notification to a specified tag with azure notification hub not working

I am not able to send notification to my device when I specify a tag to send notification. I am able to send notification when I do not specify any tag or with simple tags like "allDevice", "girls" etc. But when I use format like "username:myname.surname#mycompany.net" it s not sending notification. I am trying both with notification hub c# library or in the azure notification hub "send test" section.
I would suggest verifying the registration stored within Notification Hubs has the expected tags present on it. So manually writing some small console application (some samples here: https://github.com/Azure/azure-notificationhubs-dotnet/tree/master/Samples/RegistrationSample) or using something like Service Bus Explorer (https://github.com/paolosalvatori/ServiceBusExplorer - supports Notification Hubs) to list registrations.
From there you should be able to enumerate your registrations and see if the tag is actually stored there. If it's not there, it indicates a problem on the application side sending the tag up.
If you're still having problems, please feel free to open a support case in the Azure Portal and someone from the team can look into your particular issue and logs on our side to determine where things are going wrong.

Add single push notification to single device

I'm creating an ios application using swift for the client and C# for the server. I currently have a web app hosted in azure that communicate with the client via web api. Now I need to employ push notifications
I'm looking at Azure tutorials as my push notification provider, but it seems that it only cares about sending mass broadcasting. My need is to send custom notifications per user/device for specific notification such as "someone liked your profile" or "someone wants to connect with you" or that sort of 1-1 notifications. But look at azure example here at the section: Update server project to send push notifications (.Net) #3, there is no indication of sending a message to only one device, but rather to any device who connect to the specific hub.
So, I think the azure tutorials are not what I am looking for.
look at this lean code: He doesn't seem to be relying on any server like azure to send his notification. He is not using a hub either. He is just sending everything from a TcpClient and his notification is direct at 1 device like need it (note the deviceID he is receiving). But I've read that you must use an APNS provider all the time, so, where is his?
so, do I have to use Azure (if I want to stick to MS) to do 1-1 push notification? Does it support that? Any good tutorial about that? Or I don't need it and just simple block of C# is enough?
(I would try the code in option #2 out, but I have to setup the certificate and report back before being allocated more time)
after much investigation and trials, I found out that I don't have to rely on azure, its push notification or anything like that. I can do the entire thing by executing C# code like #2.
All I had to do is setup the .p12 certificate and give it a password. Bring it over from Mac to my pc and executed the C# code and was able to receive notifications on my phone.

Conect Adobe Flash to C#/SQl Server

I am trying to develop a DISPLAY SYSTEM (PIS:Passenger Information System).Let me explain the problem .
The system includes LCDs that is located in Stations of Metro.The passenger can see the graphically movement of the trains .the sensors sense the train and send the information to our database .this information should be displayed on the LCD and the passengers can see the trains location and arrival time on the LCD,but where is my problem ?!!my project manager said to me the information should be displayed on the LCD using Adobe Flash .but my problem is how can send the information to SWF file .i googled it and i found i can use webservices but in fact i couldn't find any useful article about this could you please give me some help and method about this .
I should display the movement of trains of lcd ,so i should send the an array to swf.
You have a variety of options
Using URLLoader, which is basically AJAX sending text. You'd have to poll to the server though regularly. Any backend should be fine for this.
You could use AMF, which works similar to the option above. But binary data is send over HTTP, so it's more efficient, but the backend has to understand AMF as well.
You could use sockets, providing a simple two communication. The backend needs of course to be a socket server.
You could use web-sockets, which is basically the new cool way for full duplex communication. The backend has to implement the websockets protocol though. I used ws in the passed and was quite satisfied.
You can use SOAP based web services, but that is way to heavy and requires using Flex, if you want to use them out of the box.
My suggestion would be a simple REST server which gets accessed via URLLoader. In the ActionScript language reference, you find examples, which are sufficient for the client development.
On the other hand ... if the backend is already set up, ask the backend guys how to access the data - I mean the protocol - and implement the client with regards to the protocol being provided.

How do I convert text-to-call?

Am building an app for WP7 Mango version. The requirement is that when ever a message is sent from that app to a predefined set of contacts, in case the number to which the message is sent is not capable of receiving messages, then, a call should be made to such numbers and the text message (intended to be sent) should be read out to on the call to the call-receiver.
I have a huge doubt that this is achievable on WP7. Am I wrong in thinking so? Is there any way that this can be achieved? If yes, how?
Well...
There is a launcher which allows an app to send SMS, but it requires user interaction, and the user can change the SMS before sending. So you have no way to know exactly which SMS was sent.
There's no API on the phone to check whether a phone number can receive SMS or not (but maybe you can figure that out yourself using the phone number prefix or something)
There's no way to programmaticaly dial a number
There's no way to play a sound to the call-receiver. Arguably the user could turn on the phone's speaker while the app plays the sound out loud
There's no way to programmaticaly tell when the call-receiver has answered the phone call. So the user would have to manually push a button in the app when the call-receiver answers
In conclusion, while it might somehow be possible, it would require so much user interaction that the app would be pretty much pointless ;)
You could achieve these requirements using an SMS and IVR service in the cloud, such as SMSIfied and Prophecy, instead of attempting to do it directly from WP7.
SMSIfied lets you send and receive text message through a simple to use REST API. You can also get the results of sending the text message in a callback. Here is a blog post "Sending SMS messages with C# and SMSified".
For phone number that will not accept SMS you can use Prophecy to dial the number and play the message using Text-To-Speech (TTS). Prophecy is programmed using the open W3C standards Call Control XML (CCXML) and VoiceXML. You use CCXML to perform the outbound dialing and when the user or answering machine answers you pass control to VoiceXML application that handles the TTS. The Prophecy IVR has excellent call progress analysis which makes it easier to get the whole message on the answering machine/voice mail. Have you ever gotten those chopped messages from an automated system? The Voxeo documentation on CCXML has good coverage on how to perform outbound dialing in Chapter F. There is a good open source project called VoiceModel that makes it easier to develop VoiceXML applications using ASP.NET MVC 4.
To initiate this outbound dialing request from WP7 would just require an HTTP request that passes the parameters like the number to dial and the CCXML application to run in the query string. The actual CCXML and VoiceXML application would be hosted as web applications.

How to do interactive SMS in .NET?

I want to write an app that sends an SMS to users, and when the recipients texts back, I receive that response, including the originating phone number, and my program can react to that response.
I've googled "Interactive SMS" but didn't find anything that was clearly a fit. Has anyone else done this, got any recommendations for a paid service that provides this kind of functionality?
Alternatively, do you have any other recommendations for how to build this service into my app, which will probably be written in C#?
Find an SMS service provider that gives you an API you can use (e.g. an HTTP API). Then read their documentation.
You need to learn about SMPP (short message peer to peer) protocol. Is the protocol usually used to communicate with carrier's SMSC (Short Message Service Center). Here's a blog entry summarizing the actual status of some C# SMPP libraries. If you don't want to use an existing .NET library, you can always write your own. SMPP is not a very complex protocol after all.
An alternative might be attach your application to a cell phone, and if that cell phone provides you with an API, use it to send and receive texts. The problem here is that it won't scale if your application expects to send and receive hundreds of thousands of text messages per day.
Yet another alternative will be to use a CARRIER AGGREGATOR company that provides you with an API for your application. There are some out there, but I don't know if they will be able to offer you a short code and the possibility to receive texts in your application. Depending on the market you are targeting, you should do a little bit of research on how other VAS companies do it over there.
You can use the TextMarks API for this. It's REST-based and super simple to use. So simple that Harvard uses it to teach new students how to use APIs. Docs here.
Messages routed to you from a user are called MO messages (Mobile Originated) and most 3rd party SMS gateways implement simple api's whereby they will simply HTTP post you incoming messages (including the originators msisdn and home network).
For example http://www.clickatell.com/products/two_way.php
Search the site for SMS Gateways for others.
Check SMS Studio - guys have done a lot on that subject and maybe you can use of-the-shelve software or customize it a little to suit your needs.
If not, at least you can find some good keywords for googling.
Anyway, you will have a choice - either go with SMS gateway, or for low volume SMS traffic, you can go with GSM Modem and handle it manually, though it's not recommended.

Categories

Resources