When sending a vcard file on an SMS message via Twilio using the mediaUrl option, it shows up on the iPhone with "text 1" next to the file as if "text 1" is the file name.
I have tried renaming the vcard file, using example vcard files, etc. No matter what the files show up as "text 1".
I have tried on iPhone 8 and 10. I have tried bare bones VCF files and full featured ones from Outlook and even example ones online such as http://www.w3.org/2002/12/cal/vcard-examples/john-doe.vcf - No matter what, they show up on iPhone as "text 1".
What can I do to make this be either the phone number or a name?
Edit --- After the comment from #philnash, I was able to add a content-disposition header to the file which now comes back in the headers as follows:
Content-Disposition: attachment; name="John Doe"; filename="john-doe.vcf"
Here is a screenshot from Fiddler:
I also renamed the file to a unique name and tried again in case Twilio or anywhere along the way was caching the old file. The header is there but the message still shows "text 1" on the iPhone.
In case it had something to do with Azure blob storage. I also coded an ASP.Net MVC file action that returns the file with the content dispostion headers - it also shows as "text 1" on iPhone.
Twilio developer evangelist here.
When Twilio provides the metadata for the MMS it does so based on the Content-Disposition header it gets when requesting the media from the URL you provide. When there isn't one available, it gets set to something generic, like "text 1" in this instance.
To overcome this, you need to set the Content-Disposition response header on the file you are serving. Within this header, you can declare a name and a filename. I haven't been able to test this (I'm not in the US, so can't receive the MMS from Twilio) but I would guess that the name is used, though I would test with filename too.
The header should look a bit like this:
Content-Disposition: inline; name="John Doe"; filename="john-doe.vcf"
I tested this some as I was having the same issue. It appears once a Vcard has been sent, subsequent sends of the same Vcard result in text 1 being sent for the name of the Vcard. However, for sends to new recipients sends with the name. ...at least from my tests.
I spent a long time troubleshooting this. I was almost going to give up. But then I sent my own contact through mms from my phone to a number controlled by twilio so I could see what headers Twilio was capturing when originating directly from an iphone. That's when I noticed this important header:
Content-Disposition: inline; filename="what-to-show.vcf"
The key here is the "inline" argument, "attachment" doesn't work. Then my stuff came over on iOS just as I wanted. ("what-to-show" instead of "text 1"). Perfect!
No fix, just adding that this experience also is replicated on Android 9 (Pie). The only discrepancy with the above is that the file is "text_1".
Related
In IOS, if you take a Voice Memo, you can Save To Files it from the share dialog. This puts it on your iphone as a file.
I am building a mobile web form with a file picker. I am trying to make it so that the accept= of the file picker will pick up voice memo files.
Currently, accept="audio/*" does NOT allow selection of the voice memo file.
Accept="*" does.
So the correct answer must be that the content-type is some other content type and not audio/*. Can anybody shed light on what it is?
Testing with https://htmlstrip.com/mime-file-type-checker on my iPhone, recorded a voice file, saved file and uploaded, this site tells me its:
audio/x-m4a
Also perhaps the component/lib for the file picker you're using doesn't support the particular filetype, or it's filtering it internally. Not sure what you're using there, but in vanilla HTML this seems doable
I am working on an app that puts a piece of generated HTML to UIPasteboard so that the user can then paste the generated HTML snippet to their email client.
I've gotten to the point where HTML content without images is properly recognized and pasted in at least Apple Mail, GMail and Yahoo Mail.
Now, when I add an img tag to the generated HTML snippet, the image can be pasted just fine to both GMail and Yahoo Mail, but Apple Mail ignores the image (still it allows the rest of the generated HTML snippet to be pasted intact).
I've tried putting the same HTML snippet to a WkWebView, copied the entire web view contents and pasted to Apple Mail. Surprisingly, the image in question got pasted to the email body, but the resulting look of the whole snippet was - should I say - simplified (e.g. colors and font styles were lost)
So I went to analyzing the item types WebKit puts on the pasteboard, and noticed a magic item type named iOS rich content paste pasteboard type. This one is not documented, and the only reference to this item type I could find in the WebKit source code mentioned something called "two-step paste" (whatever that could mean).
I modified my app code to put this "magic" item type to the pasteboard hoping that it would solve the image pasting problem. Alas - while the magic worked in terms of making my HTML snippet now look stripped of colors and font styles when pasted to Apple Mail, it did not help in pasting the image successfully.
I should also mention that I put the HTML content as both public.html and Apple Web Archive pasteboard type - however, I am not adding the WebResourceResponse key to the image subresource in the latter.
So, the questions:
What is the proper way of pasting an HTML snippet with an image to UIPasteboard so it could be correctly recognized and pasted into another app (of course, assuming the app is capable of handling HTML content from the pasteboard)
What is this "two-step paste" mode and why is it special for Apple Mail?
Could it be that Apple Mail is specifically sensitive to the WebResouceResponse key in the web archive (because both GMail and Yahoo! Mail both happily paste the image without this key being present in the web archive)?
I am trying to send a vcard via Twilio when a subscriber is added to my mailchimp list. I am using zapier for the integration. All the steps work, except when adding the vcard.
When the message is sent I get the following error message: "Twilio is unable to process the Content-Type of the provided URL. Please see the Twilio Markup XML Documentation for more information on valid Content-Types."
I understand that vcard/text is a supported type. the file is stored at https://gallery.mailchimp.com/485f8f63814a122cf8435a4ee/files/cd3791fc-83c0-469a-9029-a4a0341fe82f/johnmenke.vcf
Twilio seemed to pick up the file and read the information (the text is dsiplayed in my account), can anyone help me understand what I have wrong? I'm in the US, in case that matters.
Thank you!
Twilio developer evangelist here.
I just curled that URL and the response content type was Content-Type: application/octet-stream which is not a supported MIME type.
If you serve the file as text/vcard it should be fine. You may find that where you have hosted it can't provide the right response content type, so you may need to host it elsewhere.
If you are using nginx to serve files, you may need to add the vcard as a mime type. Some installations of nginx do not have vcard as a default mime type. For example, your nginx.conf file may contain a line like the following:
include /etc/nginx/mime.types;
And you will want to add the vcard mime type, so just append the following lines to the nginx.conf file:
types {
# here are additional types
text/vcard vcard vcf;
}
I can easily create a URL File through the O365 OneDrive web UI. Right click > New > Link. Enter the URL and save. The new item appears in the UI and when clicked, it will take you directly to the new URL, let's say it's www.google.com.
I'm attempting to duplicate this with the Graph API.
GET /me/drive/items/{folderId}/children
with:
{ name:'www.google.com.url',
file:{}
}
It creates what appears to be a link in the OneDrive UI but when clicked, it will not take you to the URL, it attempts to download a file. I've tried creating it with and without the .url suffix. The API looks pretty limited and there aren't many options to pass. I've also tried the beta API, same issue.
Links are actually a file with a special syntax similar to an INI file. From the sample you included here, it looks like you're creating an empty (0 byte) file named "www.google.com.url". Since the empty file doesn't match the format expected for a .URL file, OneDrive doesn't know what to do with it and just downloads the file.
To create a link programmatically, you would need to make a request like this:
PUT https://graph.microsoft.com/v1.0/me/drive/root/children/ShortcutToBing.url/content
Content-Type: text/plain
[InternetShortcut]
URL=https://www.bing.com
This will create a file named ShortcutToBing.url, and fill the contents of the file with the text below the request, which is the contents of a .URL file, pointing to www.bing.com.
I'm sending emails from a Rails application. The emails contain links like the following:
http://critically.in/events/14-san-francisco-ca-mc-hammer-bay-to-breakers
The URL is correct when I open it on my computer, but when I read it in Mail on my iPad or iPhone, the link is converted to:
x-apple-msg-load://90CEFE95-A78E-427F-B68E-EF184F497B69/critically.in/events/14-san-francisco-ca-mc-hammer-bay-to-breakers
Make sure your links are actually fully qualified. That is, make sure they are containing the scheme and the entire domain-path.
bad: ../blah/foo/bar
good: http://example.com/blah/foo/bar
Relative URLs are not properly resolved by the iOS mail client and result into things looking like the issue you are describing.
To be absolutely certain, make sure you check the raw message text and not the results you see within other mail-clients.