function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shawn ClarkShawn Clark 

Create & Download VCard on the Fly - Salesforce1

Hi, 

This works great on the website and one/one.app, but I cannot get it working on the iPhone. Anyone know how to do this? 

I have a Command button that calls this script from my main visualforce page:
<script>  
          var paths = '/apex/TestVCard'; 
          function onVCard() 
            {
                if( (typeof sforce != 'undefined') && (sforce != null) ) 
                {
                    sforce.one.navigateToURL(paths);
                }
                else {window.parent.location=paths;}
            }
</script>

It should then open this visualforce page, that will create and serve up the VCard for download: 
 
<apex:page showHeader="False"   cache="True" contenttype="text/x-vcard#TempImport.vcf; charset=utf-8">
BEGIN:VCARD
VERSION:2.1
FN:Bob Smith
END:VCARD
</apex:page>


Any thoughts? 

Thanks, 

Shawn