Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/205.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 通过智能手机上的网站建立新联系人_Android_Iphone_Import_Webkit_Contacts - Fatal编程技术网

Android 通过智能手机上的网站建立新联系人

Android 通过智能手机上的网站建立新联系人,android,iphone,import,webkit,contacts,Android,Iphone,Import,Webkit,Contacts,我想在我的网站上创建一个按钮,当从智能手机上单击时,它将允许用户导入我的联系信息 看起来你可以用vcard来实现这一点,但这需要智能手机用户安装额外的软件来实现 是否有类似于“tel:”href标记的东西可以触发数据导入到手机的联系人中?看一看,它使用VCalendar方法实现从网页存储联系人 此处引用的完整代码示例: <?php # Send correct headers header("Content-type: text/x-vcalendar; charset=utf

我想在我的网站上创建一个按钮,当从智能手机上单击时,它将允许用户导入我的联系信息

看起来你可以用
vcard
来实现这一点,但这需要智能手机用户安装额外的软件来实现

是否有类似于“tel:”href标记的东西可以触发数据导入到手机的联系人中?

看一看,它使用VCalendar方法实现从网页存储联系人

此处引用的完整代码示例:

<?php
# Send correct headers      
header("Content-type: text/x-vcalendar; charset=utf-8"); 
# Alternatively: application/octet-stream
# Depending on the desired browser behaviour
# Be sure to test thoroughly cross-browser

header("Content-Disposition: attachment; filename=\"iphonecontact.ics\";");
# Output file contents - simple version
#echo file_get_contents("iphonecontact.ics");

# Generate file contents - advanced version
# BEGIN:VCALENDAR
# VERSION:2.0
# BEGIN:VEVENT
# DTSTART;TZID=Europe/London:20120617T090000
# DTEND;TZID=Europe/London:20120617T100000
# SUMMARY:iPhone Contact
# DTSTAMP:20120617T080516Z
# ATTACH;VALUE=BINARY;ENCODING=BASE64;FMTTYPE=text/directory;
#  X-APPLE-FILENAME=iphonecontact.vcf:
#  QkVHSU46VkNBUkQNClZFUlNJT046My4wDQpOOkNvbnRhY3Q7aVBob25lOzs7DQpGTjppUGhvbm
#  UgQ29udGFjdA0KRU1BSUw7VFlQRT1JTlRFUk5FVDtUWVBFPVdPUks6aXBob25lQHRoZXNpbGlj
#  b25nbG9iZS5jb20NClRFTDtUWVBFPUNFTEw7VFlQRT1WT0lDRTtUWVBFPXByZWY6KzQ0MTIzND
#  U2Nzg5MA0KRU5EOlZDQVJE
# END:VEVENT
# END:VCALENDAR

echo "BEGIN:VCALENDAR\n";
echo "VERSION:2.0\n";
echo "BEGIN:VEVENT\n";
echo "SUMMARY:Click attached contact below to save to your contacts\n";
$dtstart = date("Ymd")."T".date("Hi")."00";
echo "DTSTART;TZID=Europe/London:".$dtstart."\n";
$dtend = date("Ymd")."T".date("Hi")."01";
echo "DTEND;TZID=Europe/London:".$dtend."\n";
echo "DTSTAMP:".$dtstart."Z\n";
echo "ATTACH;VALUE=BINARY;ENCODING=BASE64;FMTTYPE=text/directory;\n";
echo " X-APPLE-FILENAME=iphonecontact.vcf:\n";
$vcard = file_get_contents("iphonecontact.vcf");        # read the file into memory
$b64vcard = base64_encode($vcard);                      # base64 encode it so that it can be used as an attachemnt to the "dummy" calendar appointment
$b64mline = chunk_split($b64vcard,74,"\n");             # chunk the single long line of b64 text in accordance with RFC2045 (and the exact line length determined from the original .ics file exported from Apple calendar
$b64final = preg_replace('/(.+)/', ' $1', $b64mline);   # need to indent all the lines by 1 space for the iphone (yes really?!!)
echo $b64final;                                         # output the correctly formatted encoded text
echo "END:VEVENT\n";
echo "END:VCALENDAR\n";
?>

我不确定这是否是个好主意。。。。听上去,这相当于“拨号轰炸”,在那里,电话号码是一个高级号码,最终用户可能会收到昂贵的电话费。。。只是说说而已;考虑到最近USSD的漏洞,如果是这样的话,我会拒绝,这会促使我拨打某某的号码。。。不,谢谢!如何进行比较?在我看来,OP想要制作一个按钮,上面写着“添加我的联系信息”,这反过来会在手机上创建一个联系人。不多不少。