Is it possible to write an equivalent of SMSSecure for Windows Phone? - windows-phone

Is there an API for any version of Windows Phone that allows an application to sniff incoming SMS messages and transparently send ones, replacing the built-in SMS application with one that supports encryption like an Android's SMSSecure does?

You can't override basic apps on Windows Phone. You can't modify Contacts, Photos, Messages, Calendar...
If you want to send a SMS message you can use these lines of code:
Windows.ApplicationModel.Chat.ChatMessage msg = new Windows.ApplicationModel.Chat.ChatMessage();
msg.Body = "Hello d33tah. Nice to see you on stackoverflow!";
msg.Recipients.Add("10086");
msg.Recipients.Add("10010");
await Windows.ApplicationModel.Chat.ChatMessageManager.ShowComposeSmsMessageAsync(msg);
You can read this article in order to get more information.

Related

How to access SAP OData messages in Kapsel offline app?

We are developing an SAP Fiori App to be used on the Launchpad and as an offline-enabled hybrid app as well using the SAP SDK and its Kapsel Plug Ins. One issue we are facing at the moment is the ODATA message handling.
On the Gateway, we are using the Message Manager to add additional information to the response
" ABAP snippet, random Gateway entity method
[...]
DATA(lo_message_container) = me->mo_context->get_message_container( ).
lo_message_container->add_message(
iv_msg_type = /iwbep/cl_cos_logger=>warning
iv_msg_number = '123'
iv_msg_id = 'ZFOO'
).
" optional, only used for 'true' errors
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
EXPORTING
message_container = lo_message_container.
In the Fiori app, we can directly access those data from the message manager. The data can be applied to a MessageView control.
// Fiori part (Desktop, online)
var aMessageData = sap.ui.getCore().getMessageManager().getMessageModel().getData();
However, our offline app always has an empty message model. After a sync or flush, the message model is always empty - even after triggering message generating methods in the backend.
The only way to get some kind of messages is to raise a /iwbep/cx_mgw_busi_exception and pass the message container. The messages can be found, in an unparsed state, in the /ErrorArchive entity and be read for further use.
// Hybrid App part, offline, after sync and flush
this.getModel().read("/ErrorArchive", { success: .... })
This approach limits us to negative, "exception worthy", messages only. We also have to code some parts of our app twice (Desktop vs. Offlne App).
So: Is there a "proper" to access those messages after an offline sync and flush?
For analyzing the issue, you might use the tool ILOData as seen in this blog:
Step by Step with the SAP Cloud Platform SDK for Android — Part 6c — Using ILOData
Note, ILOData is part of the Kapsel SDK, so while the blog above was part of a series on the SAP Cloud Platform SDK for Android, it also applies to Kapsel apps.
ILOData is a command line based tool that lets you execute OData requests and queries against an offline store.
It functions as an offline OData client, without the need for an application.
Therefore, it’s a good tool to use to test data from the backend system, as well as verify app behavior.
If a client has a problem with some entries on their device, the offline store from the device can be retrieved using the sendStore method and then ILOData can be used to query the database.
This blog about Kapsel Offline OData plugin might also be helpful.

Integrate chatbot into any third-party messaging API

I want to make a unified "inbox" for messages from across multiple platforms, some of them are widely supported by all mejor chatbot services, like Facebook Messenger, others are more obscure like WhatsApp, but others are plain unsupported (like Steam Web Chat).
I've encountered several solutions that have some sort of "one-click" integration for the most popular messengers, but I can't find one that will let you integrate third-party messengers (which ideally have an API to read/send messages at the very least) into a chatbot-like service. Is there such a thing out there?
PS: I don't really care about fancy AI conversational support, I'd just like to receive all messages into, say, one webhook I can then act on, and also be able to reply to them.
API.ai doesn't have an 'integration pooling' architecture, it treats each platform as a separate integration or conversation. Given that, you'll have to build your own server side message pooling solution which plugs into all your 3rd party APIs, and then pools/queues messages across all streams before passing to API.ai, and with some messageID/tracking system on your server side solution to remember which 3rd party API to respond to with API.ai response. Something like this as an aggregate/pooling function should work:
var queue = [];
var queueProcessing = false;
function queueRequest(request) {
queue.push(request);
if (queueProcessing) {
return;
}
queueProcessing = true;
processQueue();
}
function processQueue() {
if (queue.length == 0) {
queueProcessing = false;
return;
}
var currentRequest = queue.shift();
//Send to API.ai
request(currentRequest, function(error, response, body) {
if (error || response.body.error) {
console.log("Error sending messages!");
}
processQueue();
});
}
What I would do is have a Node.js backend.
Direct every messaging integration to it and then direct that to API.AI.
So the flow would be like this:
There is a service called Message.io which does I believe what you want. They support the widest range of platforms.
Message.io sits between your bot and the messaging platforms, you receive messages in a standardized way from Message.io, and when sending messages out to users, it converts it to the appropriate format for the platform you're responding to.

`StreamSocketListener`-based server in Universal App

It is known that Windows 8.1 and Windows Phone 8.1 put lots of constraints on background activities of third-party app. For instance, it is impossible to develop server-like capability (e.g. BitTorrent) in Store App without having to keep the screen always-on using DisplayRequest.
From the latest documentation, I have a feeling that one can utilize the method EnableTransferOwnership of StreamSocketListener to delegate the usual request processing code to a background task. The problem is that I don't know how IBackgroundTask should work in this case. Normally, they are activated by some conditions/triggers such as "Internet becomes available". The only sensible trigger in this case seems to be ControlChannelTrigger but apparently, the documentation implies that it cannot be used with StreamSocketListener since the app needs to be the one who creates and register a StreamSocket, not waiting for the socket to be created by some connecting client.
Is it possible now to implement a StreamSocketListener-based server in Windows 10 Universal app platform? If it is, how can I do that?
Use it to activate a background task on socket activity such as receiving data when the app is not active, e.g.:
var socketTaskBuilder = new BackgroundTaskBuilder();
socketTaskBuilder.Name = "SocketActivityBackgroundTask";
socketTaskBuilder.TaskEntryPoint = "SocketActivityBackgroundTask.SocketActivityTask";
var trigger = new SocketActivityTrigger();
socketTaskBuilder.SetTrigger(trigger);
var task = socketTaskBuilder.Register();
socket = new StreamSocket();
socket.EnableTransferOwnership(task.TaskId, SocketActivityConnectedStandbyAction.Wake);
For a complete example, look at the Socket Activity sample or the documentation.

How do I program a mobile app to send SMS?

I want a mobile app to send automated SMS. This will be in VB.Net. I've searched for articles on these but they are all about PC apps accessing a GSM modem or a mobile through a COM port. Is it the same process with mobile apps on the phone (not through a PC)? If yes, and I am to treat the GSM modem as a "port", how would I connect to it? If no, are there any useful resources for this?
Sending SMS is easy with windows mobile. You need a reference to mobile.poutlook namespace.
"Send SMS from Pocket PC, SMartphones, Windows mobile
To send an SMS Message we’ll first need to make reference to the Microsoft.WindowsMobile.PocketOutlook namespace.
Imports Microsoft.WindowsMobile.PocketOutlook
After that it’s as simple as creating a new instance of the SMSMessage class with an overloaded onstructor passing in the Recipient Mobile number and SMS text, then invoking the Send method"
Source.
Download VB code directly.
MS reference.
MS Snippet:
public void SmsMessageSend()
{
SmsMessage smsMessage = new SmsMessage();
//Set the message body and recipient.
smsMessage.Body = "Would you like to meet for lunch?";
smsMessage.To.Add(new Recipient("John Doe", "2065550199"));
smsMessage.RequestDeliveryReport = true;
//Send the SMS message.
smsMessage.Send();
return;
}
An automated VB translation of the above snippet:
Public Sub SmsMessageSend()
Dim smsMessage As New SmsMessage()
'Set the message body and recipient.
smsMessage.Body = "Would you like to meet for lunch?"
smsMessage.To.Add(New Recipient("John Doe", "2065550199"))
smsMessage.RequestDeliveryReport = True
'Send the SMS message.
smsMessage.Send()
Return
End Sub
The above is not VB as asked, but unfortunately MS does not provide the VB snippet there.
All this will only work, if you are using a windows mobile device. It will not work on windows ce devices.
You should consider your internet searches for mobile API and code. I always start with "compact framework" to get code related results only. Then I add the keywords I search for. In example: "compact framework send sms" gives a good result list that you can work on.

Line break problems sending SMS through SMTP ftrom VB.NET

I wrote a VB.NET application to send notifications by SMS using an SMTP gateway (mobilenumber#mobileprovider.com).
The message includes line breaks and display well under most providers but not all.
For some providers, the message will display in one line with line breaks showing as "0D0A" which just won't work for me.
Is therea solution to this problem?
Using an SMS agregator is out of the question for my solution.
Yes, I did that. Turned out to be carrier specific.
Yet another problem i am having is specific to the phone model (one specific user receive the messages well on his old razor, changed to a new motorola phone with the same carrier and now receives an empty message).
Any ideas ?
This is neither vb.net or smtp problem.
It sure looks like it is mobile provider specific. Try checking your (mail message) encoding - have you tried pure ASCII?
If I'm not mistaken 0D0A is UTF-8 for line break...