I use twilio to share contact information of my users. I've been doing this for 6 months with no problems.
Recently, I started receiving bug reports that the contact card isn't coming through. iOS is receiving it as an unknown attachment with a file name such as 'text_0.x-vcard' [see screenshot]
I'm unable to reproduce this on my device - I've received reports of this from users with an iPhone 7, iPhone 6, and iPhone 5 - nothing consistent. No consistency in OS either. The vcf file is valid, and it works for 90% of users.
Any ideas? Here is an example of a vcf file - works on my phone, doesn't work on one of the other devices.
BEGIN:VCARD
VERSION:3.0
N:Doe;John;;;
FN:John Doe
ORG:Example.com Inc.;
TITLE:Imaginary test person
EMAIL;type=INTERNET;type=WORK;type=pref:johnDoe#example.org
TEL;type=WORK;type=pref:+1 617 555 1212
TEL;type=WORK:+1 (617) 555-1234
TEL;type=CELL:+1 781 555 1212
TEL;type=HOME:+1 202 555 1212
item1.ADR;type=WORK:;;2 Enterprise Avenue;Worktown;NY;01111;USA
item1.X-ABADR:us
item2.ADR;type=HOME;type=pref:;;3 Acacia Avenue;Hoemtown;MA;02222;USA
item2.X-ABADR:us
NOTE:John Doe has a long and varied history\, being documented on more police files that anyone else. Reports of his death are alas numerous.
item3.URL;type=pref:http\://www.example/com/doe
item3.X-ABLabel:_$!<HomePage>!$_
item4.URL:http\://www.example.com/Joe/foaf.df
item4.X-ABLabel:FOAF
item5.X-ABRELATEDNAMES;type=pref:Jane Doe
item5.X-ABLabel:_$!<Friend>!$_
CATEGORIES:Work,Test group
X-ABUID:5AD380FD-B2DE-4261-BA99-DE1D1DB52FBE\:ABPerson
END:VCARD
Steph,
I'm new to Stack Exchange, so I don't know how else to send this. You show one of your Twilio numbers above.
I am seeing similar issues, and I believe it is all related to your content type. Try a
curl --head <your vcard web address>
The only time I've had it work for me is when the it returned
Content-Type: text/x-vcard; charset=utf-8; name="fileName.vcf"
I don't know how long this link will last but try sending this vcard VCF File (Send from http address), it works for me on Twilio w/ iOS 10.3.3
I think your right about it being related to security; why would you want a 'text/html' file being being executed like a 'text/x-vcard' file. I don't think internal header modifiers will work, let me know.
Related
I use the distriqt scanner ane and it works very vell on iOS. But with the similar app on Android it crashes the app immediately (while calling Scanner.service.startScan( options ))
I got follwing from logcat:
E/QCOM PowerHAL( 313): Invalid hint ID.
E/mm-camera-intf( 313): mm_camera_open: opened, break out while loop
E/InputDispatcher( 858): channel '2da9ab5b air.myfunnyappidcovered/air.myfunnyappidcovered.AppEntry (server)' ~ Channel is unrecoverably broken and will be disposed!
E/InputDispatcher( 858): channel 'e01d279 air.myfunnyappidcovered/com.distriqt.extension.scanner.zbar.ZBarScannerActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
Any Idea? All permissions and permission-freatures are set. The AS-Code works, like the iOS-compile shows. Tested with the same result on different Android-devices.
I working on UPnP device implementation in iOS and I have downloaded the source code from here. Using the sample I am able to discover the UPnP devices on the network but when I try to fetch the description of the device I am getting an issue.I have not changed anything in the default code still I am getting this issue.
Request:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body><u:GetSortCapabilities xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
</u:GetSortCapabilities></s:Body></s:Envelope>
Response:
Error (SoapAction): Got a non 200 response: 500. Data:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode>
<faultstring>UPnPError</faultstring><detail>
<u:UPnPError xmlns:u="urn:schemas-upnp-org:control-1-0">
<u:errorCode>801</u:errorCode>
<u:errorDescription>Access denied</u:errorDescription>
</u:UPnPError></detail>
</SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
Can anybody suggest me how to resolve this?
Not sure if this will fix your problem, but just a couple days ago, I discovered that the default newline in windows is "\r\n" (ascii 13 and 10) and the default newline in iOS is "\n" (ascii 10 only).
This caused some UPnP implementations to NOT respond to my search requests. The UPnP Standard requires "\r\n" in general for a newline. You may want to look at the actual bytes and see if 13 and 10 are always together, or if you're only getting the 10.
I am just wondering how you would go about grabbing articles from BBC and automatically updating this information in an iOS app. So basically what I want to do is add new articles to my application automatically whenever BBC release them. Is this possible?
Its very simple.. Grab the sample code from this tutorial. http://www.appcoda.com/ios-programming-rss-reader-tutorial/
and in APPMasterViewController.m change url to something like
NSURL *url = [NSURL URLWithString:#"http://feeds.bbci.co.uk/news/rss.xml”];
you can get other types of news feeds from their page http://www.bbc.co.uk/news/10628494..
Yes you can do this by getting the information from their RSS Feed.
http://feeds.bbci.co.uk/news/world/us_and_canada/rss.xml
it will return you an XML document and you can parse it and dispaly them in your app
sample article info
<title>US boy charged in death of teacher</title>
<description>A 14-year-old boy has been charged in the death of a teacher whose body was found in woodland behind her school.</description>
<link>http://www.bbc.co.uk/news/world-us-canada-24644203#sa-ns_mchannel=rss&ns_source=PublicRSS20-sa</link>
<guid isPermaLink="false">http://www.bbc.co.uk/news/world-us-canada-24644203</guid>
<pubDate>Wed, 23 Oct 2013 19:03:05 GMT</pubDate>
<media:thumbnail width="66" height="49" url="http://news.bbcimg.co.uk/media/images/70673000/jpg/_70673073_chism.jpg"/>
<media:thumbnail width="144" height="81" url="http://news.bbcimg.co.uk/media/images/70673000/jpg/_70673074_chism.jpg"/>
</item>
Check out APIs for developers from this link:
http://www.bbc.co.uk/developer/technology/apis.html
Grab your api and parse date - in my opinion JSON is the most comfortable format on iOS.
Then you could compare fresh, parsed data to data on the device and check is there something new.
I have this posted on PhoneGap google groups and cross-posted it here on Stack Overflow.
Anyway, PhoneGap's Contact API is giving me headache lately. To cut it short:
Environment
iOS 6
PhoneGap 2.0.0
I have this application that scans a QR code with VCard embeded, and it will save it into user's contact once the user agree to save it down. On Android 4.1.2, this piece of code works flawlessly without any error, and contact was saved too. On iOS 6, however, I can't get it to work. What I have always receive is error #4, which is, ContactError.IO_ERROR.
The code is as below:
navigator.notification.confirm('Found a contact: "'+(vcard['N'] || '')+'". Add it into your contact list?', function(btn) {
if (btn == 1) {
var contact = navigator.contacts.create();
contact.displayName = vcard['N'] || '';
contact.emails = [new ContactField('email', vcard['EMAIL'] || '')];
var org = new ContactOrganization();
org.name = vcard['ORG'] || '';
contact.organizations = [org];
contact.save(function() {
navigator.notification.alert('Contact Saved');
}, function(err) {
navigator.notification.alert('Error on saving contact: '+err.code);
});
}
}, 'QR Code Scanner', 'OK,Cancel');
And below is the only log I have seen on XCode right after I tap on 'OK': (first callback is for the notification.confirm)
2012-10-22 21:19:24.619 [11897:907] PluginResult:toJSONString - {"status":1,"message":1,"keepCallback":false}
2012-10-22 21:19:24.621 [11897:907] PluginResult toSuccessCallbackString: cordova.callbackSuccess('Notification12',{"status":1,"message":1,"keepCallback":false});
2012-10-22 21:19:24.738 [11897:907] PluginResult:toJSONString - {"status":9,"message":4,"keepCallback":false}
2012-10-22 21:19:24.739 [11897:907] PluginResult toErrorCallbackString: cordova.callbackError('Contacts13',{"status":9,"message":4,"keepCallback":false});
Then I will see the alert:
Error on saving contact: 4
Note
vcard is a key-value pair of vcard obj. Please ignore this for now. It's not important.
This piece of code works fine on android.
Is this the correct way of creating contact? How can you save a contact on iOS 6 using PhoneGap?
Edit
I did all the necessary migration and upgraded to v2.1.0, but the error code still emerges. Why is this?
Edit
Apparently this has something to do with the new AddressBook permissions request on iOS 6 as mentioned by Mark, but no one has answered me on how to do it properly. Spent some times on research I came to a conclusion that it's best if we can just wait for Phonegap to finish up v2.2 as I saw permission request being added in CDVContacts.m in v2.2 rc2 commit 61857860...
https://issues.apache.org/jira/browse/CB-902
Currently crashes if the user does not have AddressBook permission on iOS 6.
The user will get a popup dialog similar to the Geolocation permissions dialog. When creating an address book, we should handle the condition where the app does not have permission, and the address book returned is NULL.
i've had the same problem. As it turns out, i was using phonegap version 1.9, which did not support iOS 6, therefore adding a contact gave me Error 4 message all the time. To fix this, i upgraded to phonegap version 2.1. This version supports iOS 6 as well as both armv6 and armv7 architectures. The error message was because iOS 6 requires permissions to access the address book, in the same way that using the GPS requires permission on iOS. This should solve your problem, it did for me :)
The documentation states for CTCarrier's carrierName "The value does not change if the user is roaming; it always represents the provider with whom the user has an account."
It does not say the same about mobileNetworkCode however. Does this change based on the current carrier or does it remain constant too?
I am trying find if the phone is roaming in a startMonitoringSignificantLocationChanges callback so would like to avoid geolocating.
I'm roaming right now - in Switzerland on an AT&T iPhone 4 on Swisscom. Just wrote a quick program to test. Here's what I got:
2011-04-29 09:01:55.657 test[2094:707] Carrier Name: AT&T
2011-04-29 09:01:55.665 test[2094:707] ISO Country Code: us
2011-04-29 09:01:55.669 test[2094:707] Mobile Country Code: 310
2011-04-29 09:01:55.678 test[2094:707] Mobile Network Code: 410
So, to answer your question, doesn't look like mobile network code changes (410 is AT&T as cited below)