官方文檔:javascript
邀請好友組件php
應用分享組件html
1、邀請好友組件java
1.調用urljquery
http://app.t.qq.com/invite/index?appid=xxx&app_custom=test&msg=hiapp
2.使用示例網站
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script type="text/javascript" src="jquery-1.4.2.js"></script> </head> <body> <iframe width="800" height="600" scrolling="no" src="http://app.t.qq.com/invite/index?appid=xxx&app_custom=test&msg=hi"></iframe> // 這段iframe就是官方邀請界面 </body> </html>
3.url參數說明url
1)appid: 必填,表示應用的idspa
2)app_custom: 可選,一個可自定義的回調參數,該參數會填入到發送的邀請連接裏,並最終做爲參數傳遞到開發者的應用連接中,傳遞過程當中其值保持不變,開發者可經過該參數 實現一些自定義的功能,app_custom參數在好友點擊邀請連接後跳轉到應用詳情頁便可獲取code
3)msg: 可選,表示發送的邀請文字信息,長度不得超過60漢字,若是爲空,系統會自動生成一個邀請內容:親,一我的的遊戲好冷、好孤單,我們一塊兒來玩「<該應用的名稱>」吧,好麼?
2、應用分享組件(FB平臺的feed&share)
達到一樣分享效果的還有一鍵分享功能。 微博組件一鍵分享
(一)分享組件
1.調用url
http://app.t.qq.com/share/index?appid=24341&msg=hi
2.使用示例
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script type="text/javascript" src="jquery-1.4.2.js"></script> </head> <body> <iframe width="800" height="600" scrolling="no" src="http://app.t.qq.com/share/index?appid=24341&msg=hi"></iframe> // 這段iframe就是總店 </body> </html>
3.url參數說明
1)appid: 必填,表示應用的id
2)msg: 可選,表示發送的分享文字信息,長度不得超過100漢字,若是爲空,系統會自動生成一個分享內容:我正在使用#XXX#應用,很不錯哦,推薦你也來玩。
(二)一鍵分享 (這個主要是用戶網站分享,不過經過接口請求也可以遊戲應用中使用)