I want to send MMS in iOS and for that I will be using Message Composer API.
Now I can send mms by adding text in body and image as attachment.
But I want to send message which will be combination of image and text:
ex :
Hi [image] how are you [image] .
How can I achieve this.
Sending MMS via MFMessageComposeViewController is available in iOS 7 only:
First check if you can send MSS with the canSendAttachments method:
if ([MFMessageComposeViewController canSendAttachments]) {
// YES we can send a MMS
}
The easiest way is to use addAttachmentURL:withAlternateFilename: to attach attachments to you messages. You are not able to get your image in the middle of the text.
Related
I currently have the following code which successfully replies any message I send with "Ola":
#app.route("/bot", methods=["POST"])
def bot():
incoming_msg = request.values.get('Body', '').lower()
resp = MessagingResponse()
msg = resp.message()
quote = 'Ola'
msg.body(quote)
return str(resp)
I would like to have response buttons to my reply. Please see attached image, I'd like to add the "Got it" button with my message text. Is that possible for python. Thanks.
To send quick reply or call to action buttons over WhatsApp using Twilio, you need to create a template and add the buttons to the template. To trigger the template, you need to send a message containing the text of the template in the body. This is all covered in more detail in the Twilio documentation on using buttons in WhatsApp.
Note, you need to have a working WhatsApp number in your account to create and send templates. You cannot use the Sandbox to test out this feature.
I am following this below library for my applications where user have to chat with other user.
SocketChat
There I can chat with other users. Now my prime concern is to send images to server and then that image is going to reflect in the chat of the other user's window. Its like Group chat.
I am done with image sending from iOS app
I don't know what to write to handle byte array which is of the image I sent from one of the client.
clientSocket.on('images', function(clientNickname, message){
var currentDateTime = new Date().toLocaleString();
var dataType = "imageType"
delete typingUsers[clientNickname];
io.emit("userTypingUpdate", typingUsers);
io.emit('newChatMessage', clientNickname, message, currentDateTime,dataType);
});
I think its not working. Its good for the string type data. Can you please let me know what to write there in order to receive image and send that back.
I know there is event listener in TriggerIo to catch received push notifications from Parse:
forge.event.messagePushed.addListener(function (msg) {
alert(msg.alert);
});
But the 'msg' object contains only 'alert' and 'sound' keys...
Is there a way to receive at least a channel name to which push notification was sent? I need this to decide which view to open in my app as each channel has it's own destination. And if this is not possible, maybe there is another way to do this?
P.S I suppose it could be done by inserting some kind of 'keyword' into message it self, but I would rather avoid it.
I just realised, that there is a way to send so called JSON payload via Parse push submission form.
{
"alert" : "My message",
"additional" : "data"
}
More info: https://parse.com/questions/json-format-to-send-notification-from-parse
I configure my ios application with pushwoosh SDK and its really simple and work fine.
Now i want to send for example an id of a product to show when push i received or any think else but user have no to see this data. i try page but dont work to.
Q1 : how can i do it ?.
Q2 : what is this page ?.
Edit: i just found the documentation of Rich pushes ( page ) : link , i send a push notification with title=test and a page witch contain an href to google , but in onPushReceived: withNotification: onStart: function this is the description of dictionary of the received push:
{
aps = {
alert = test;
sound = default;
};
h = 774;
p = x;
}
as i see, the 774 is the id of the page send in the push message, ok i can use that but how can i get the content of that page ( a web service ? )
You can send your Custom Data through Remote API request. Currently you cannot do that via the web form.
As for Remote API, it's pretty simple. See the guide on this:
http://www.pushwoosh.com/programming-push-notification/pushwoosh-push-notification-remote-api/#PushserviceAPI-Method%2Fmessages%2Fcreate
I am building an application where I need the option to share via email and SMS.
I have done the share via Email, where when the user selects the image, the url is passed as the content of the email. But while sharing via SMS, I can't do something like setContent as I did for email and fetch the url in the SMS directly, instead of user typing the address manually.
I am using Message class in email and MessageConnection class for SMS, as shown in the blackberry community example.
The Message object you receive when calling MessageConnection.newMessage(TEXT_MESSAGE) is actually a TextMessage object (or a BinaryMessage object with BINARY_MESSAGE).
If you cast the received object to the proper class (TextMessage or BinaryMessage), you should be able to use its setPayloadText(String data) (or setPayloadData(byte[] data) for a BinaryMessage) to enter a value in the message before sending it.
Your code should look like this:
Message msg = myMessageConnection.newMessage(TEXT_MESSAGE, /* address */);
TextMessage txtMsg = (TextMessage)msg;
txtMsg.setPayloadText(/* Text to send */);
myMessageConnection.send(msg);
When you send an email, you can set the body of it and send it to the user from the Email native application. You cant do taht for SMSs. I worked on that issue and for BB Torch I was able to set the text of the SMS message but for other devices that was impossible. I always obtain an empty text message!!
So y suggestion to you is using the following code wich will send the SMS to a number without the interference of the user
MessageConnection conn = (MessageConnection) Connector.open("sms://" + userNumber);
TextMessage txtmessage = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
txtmessage.setPayloadText(text);
conn.send(txtmessage);