移動端網頁站點調用撥打電話發送短信等功能

  1. 打電話
    在android的瀏覽器中,如果電話號碼是 XXX-XXX-XXXX的型式的話,用戶點擊的時候,撥號面板會激活,但是如果不是這一特定的格式,那麼撥號功能是不會啓動的。其實可以通過鏈接的方式激活撥號面板。

(1) IPhone的寫法

[phone_number] 就是電話號碼了
<a href="callto:[phone_number]">phone_number</a>

例子:

<a href="callto:12345678">12345678</a>

(2) Android的寫法

[phone_number] 就是電話號碼了
<a href="wtai://wp/mc;[phone_number]">phone_number</a>

例子:

<a href="wtai://wp/mc;12345678">12345678</a>

在電話號碼前面可以加上 + (加號)表示國際號碼。如:

<a href="wtai://wp/mc;+12345678">+12345678</a>
  1. 短信
    如果是需要調用短信的接口,可以將鏈接寫成下面的格式:
sms:<phone_number>[,<phone-number>]*[?body=<message_body>]

例如:

<a href="sms:12345678">給12345678發短信</a>

<a href="sms:12345678?body=hello">給12345678發送內容爲"hello"的短信</a>

<a href="sms:12345678,98765432?body=hello">給12345678和98765432發送內容爲"hello"的短信</a>
  1. Android Market
    如果希望一個鏈接能夠激活Android市場的功能,可以把鏈接寫成:
<a href="market://search?q=[query]">Android Market link</a>

其中就是搜索的內容,你應用的名稱例子:

<a href="market://search?q=MyApp">MyApp</a>
  1. Ovi Store
    這是諾基亞Nokia的一個應用市場。
<a href="http://store.ovi.com/content/XXXXX">MyApp</a>

XXXX就是你的應用的ID(application Id)。

  1. Windows Marketplace
    微軟的應用市場
<a href="http://marketplace.windowsphone.com/details.aspx?appId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">MyApp</a>

其中 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 只的就是應用的ID

  1. BlackBerry App World
    黑莓的應用市場
<a href="http://appworld.blackberry.com/webstore/content/XXXXX">MyApp</a>

鏈接中的XXXX就是應用ID。下面這個是作者頁面的URL

<a href="http://appworld.blackberry.com/webstore/vendor/XXXX">MyApp</a>

其中的XXXX是指作者的ID

  1. 地圖定位GPS
<a href="geopoint:[經度],[緯度]">我的位置</a>

例如:

<a href="geopoint:100,23">我的位置</a>
  1. 聊天工具
    (1) Yahoo Messager
<a href="ymsgr:[動作]?[用戶名]&m=[消息]">Yahoo Messager</a>

[動作]有:addfriend, sendIM, call例子:

<a href="ymsgr:sendIM?[email protected]">[email protected]發消息</a>

(2) Windows Messager (MSN)

  <a href="msnim:[動作]?contact=[用戶名]">Windows Messager</a>
    [動作]有:chat (聊天), add (添加成聯繫人), voice (語音), video (視頻)

例子:

<a href="msnim:chat?[email protected]">MSN</a>

(3) Google Talk (GTalk)

   <a href="gtalk:[動作]?jid=[用戶名]&from_jid=[自己的用戶名]">GTalk</a>
 [動作]有:chat (聊天),call (語音)例子:
<a href="gtalk:chat?[email protected]&from_jid[email protected]">GTalk</a>

(4) Skype

   <a href="skype:[用戶名]?[動作]">Skype</a>
   [動作]有:chat, add, userinfo, voicemain

例子:

<a href="skype:mySkypeId?chat">Skype</a>
  1. Mail
    郵件就和普通的html一樣使用mailto
<a href="mailto:[email protected]"></a>

<a href="mailto:[email protected],[email protected]"></a>

<a href="mailto:[email protected]?subject=Testing"></a>

<a href="mailto:[email protected]?subject=Testing mailto&cc[email protected]"></a>

現在一般用在鏈接上加入:

<a href="tel:1233434334">
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章