I am developing a simple windows phone 8 app using visual studio express 2012 and WP8 SDK using C# and SQLite. I would like to know how to send SMS or email to various recipients using this app with my windows phone (I do not want to send SMS through internet )
thanks a lotttt :)
You can't send an SMS or an email (from system account) without user approval. To do that use Launchers:
Email: Use EmailComposeTask: How to use the email compose task for Windows Phone
SMS: Use SmsComposeTask: How to use the SMS compose task for Windows Phone
They both shows popup and ask user to approve the message to be send.
in windows phone 8.1 i use the following code in C#:
ChatMessage chatMessage = new ChatMessage();
chatMessage.Body = "Text message";
chatMessage.Recipients.Add("phonenumber");
await ChatMessageManager.ShowComposeSmsMessageAsync(chatMessage);
Hope it helps :)
Related
I want to send pushnotifications to windows phone.
string subscriptionUri = "https://hk2.notify.windows.com/?token=AwYAAAAqksei6yWvmlcV8RmESRNrXotwCWV0AY9PSOtmgpIo%2bNwq67tkYjG7450r%2bUKpLwxri%2bO7Re9%2f8qmZDAc3TmTlMOaONVqq9ogCKONX2oWe%2fVq%2bT9tIxEllJW3tnKJEfNM%3d";
//string subscriptionUri = "http://s.notify.live.net/u/1/hk2/H2QAAACfgMkOSS8jNp_XgLamnXFqQrk6g8L6pRJHsQxvppe8-lD4EgCu8LcwdtuDIGnY78tjyaL1lsFxLjWl5s-Sgum5tjBQMk-9emm73LJa9125iECyFCoPb5erRBRwGAgNv2o/d2luZG93c3Bob25lZGVmYXVsdA/jGFxihnYNUOIt5Q4gABT7Q/T4l1SvWZqMi_mEe4F61sx-CINOg";
in the above two channeluris first one is Windows RT app uri,second one is Silverlight app uri.Iam getting notification whenever silverlight app uri used.but I am not getting notification whenever windows RT app uri used.whenever
I am sending windows RT app uri to the server then response is "OK" but not getting any notification to my device.please help me.
Have you enabled toast notification? In Package.appxmanifest, Under Application tab there is "Notifications" option "Toast Capable" set it to "yes"
One more possibility is the subscription uri is getting decoded at the receiving end.
I want to send pushnotifications to windows phone.
string subscriptionUri = "https://hk2.notify.windows.com/?token=AwYAAAAqksei6yWvmlcV8RmESRNrXotwCWV0AY9PSOtmgpIo%2bNwq67tkYjG7450r%2bUKpLwxri%2bO7Re9%2f8qmZDAc3TmTlMOaONVqq9ogCKONX2oWe%2fVq%2bT9tIxEllJW3tnKJEfNM%3d";
//string subscriptionUri = "http://s.notify.live.net/u/1/hk2/H2QAAACfgMkOSS8jNp_XgLamnXFqQrk6g8L6pRJHsQxvppe8-lD4EgCu8LcwdtuDIGnY78tjyaL1lsFxLjWl5s-Sgum5tjBQMk-9emm73LJa9125iECyFCoPb5erRBRwGAgNv2o/d2luZG93c3Bob25lZGVmYXVsdA/jGFxihnYNUOIt5Q4gABT7Q/T4l1SvWZqMi_mEe4F61sx-CINOg";
in the above two channeluris first one is Windows RT app uri,second one is Silverlight app uri.Iam getting notification whenever silverlight app uri used.but I am not getting notification whenever windows RT app uri used.whenever
I am sending windows RT app uri to the server then response is "OK" but not getting any notification to my device.please help me.
Have you enabled toast notification? In Package.appxmanifest, Under Application tab there is "Notifications" option "Toast Capable" set it to "yes"
One more possibility is the subscription uri is getting decoded at the receiving end.
I am trying to find a way to send a toast notification from a windows universal application. The Azure documentation does mention a way to do this from a Console Application. This does not meet my use case though, where I want to send toast notifications from a windows universal application. The problem is the nugget package Microsoft.Azure.Service.Bus is not compatible with a windows store or windows phone 8.1 application.
Is there any Windows Azure library that will allow me to send a toast notification from Windows universal application.
Typically you wouldn't send the toast from the Universal app. You would send the toast to the app to let the user know that something occurred on the server.
If you want to schedule a toast from the app to the local system then you don't need Azure (or another web service). You can schedule that directly with a scheduled notification. See Quickstart: Sending a toast notification (XAML) and How to schedule a toast notification (XAML)
If you want to push a notification elsewhere then you can set up an Azure Notification Hub and connect to it through its REST service via the HttpClient class.
More typically though your app would contact your back-end server to connect to the notification hub. This can be readily set up with an Azure Mobile Service. See Add push notifications to your Mobile Services app
Bellow two basics samples:
Sample 1 text only
const ToastTemplateType toastTemplate = ToastTemplateType.ToastText01;
var toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);
var toastTextElements = toastXml.GetElementsByTagName("text");
toastTextElements[0].AppendChild(toastXml.CreateTextNode("Hello World!"));
var toast = new ToastNotification(toastXml);
ToastNotificationManager.CreateToastNotifier().Show(toast);
Sample 2 text and image
const ToastTemplateType toastTemplate = ToastTemplateType.ToastImageAndText01;
var toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);
var toastTextElements = toastXml.GetElementsByTagName("text");
toastTextElements[0].AppendChild(toastXml.CreateTextNode("Hello World!"));
var toastImageAttributes = toastXml.GetElementsByTagName("image");
((XmlElement)toastImageAttributes[0]).SetAttribute("src", "https://i.stack.imgur.com/wzdIt.jpg");
var toast = new ToastNotification(toastXml);
ToastNotificationManager.CreateToastNotifier().Show(toast);
Toast notifications are small pop ups that appear on the screen for few seconds. They convey messages and can be customized to even play different sounds.
See the Windows Universal Apps notifications sample for more.
Good morning,
is it possible to send an automatic email message within a Windows Phone 8.1 universal app? I want to set an eMail adress and then the message will be send from this address.
Is it possible without interaction of the user?
I think anything in the Windows Phone SDK will enforce user interaction.
It is possible nevertheless. I have some experience of MailMessage component, which lets you achieve what you desire - but I'm sure there's others out there too.
http://www.geekchamp.com/marketplace/components/livemailmessage
By design, this is not possible: sending email from a user's email address without their knowledge is a security risk.
An alternative is to build a webservice that sends the email, and have your application call that webservice, instead.
In my windows phone 8 app, I call to external APIs developed by client may be in PHP.
They told us that the user agent is showing NativeHost.
They want it to be Windows Phone so that they could better track the windows phone requests.
Try setting the HttpWebRequest.UserAgent property.
Tr this one
HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("User-Agent", "my-user-agent-name");
Hope you are using HTTP client to make call to external API