脚本宝典收集整理的这篇文章主要介绍了php – FaceBook集成麻烦的问题,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
从这个App Daily Tools和我的实际游戏中获取的描述是Just Double It
描述:我的游戏说明我的应用说明.
描述是自动检测到的,而不是我写的.
VAR APP_ID="*****************"; window.fbAsyncInit = initFacebook; function initFacebook() { FB.init({ appId : APP_ID,status : true,// check login status cookie : false,// enable cookies to allow the server to access the session xfbML : true // parse XFBML }); FB.getLOGinStatus(onFacebookLoginStatus); }; (function() { var e = document.createElement('script'); e.src = document.location.PRotocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').apPEndChild(e); }()); //the login function function facebookLogin() { var loginUrl="http://www.facebook.COM/dialog/oauth/?"+ "scope=publish_stream&"+ "client_id="+APP_ID+"&"+ "redirect_uri="+document.location.href+"&"+ "response_type=token"; window.location=loginUrl; } function postToWallUsingFBApi() { var score=atob(document.getElementById("txtscore").value); var data= { caption: "scores "+score,message: "I challenge you to beat my score "+score + " in Just Double It! on your AndROId Phone !!!",picture: "http://www.learning-delight.com/ldapps/Game/main.png",link: 'https://play.GOOGLE.com/Store/apps/details?id=com.appslight.justdoubleit',} FB.api('/me/Feed','post',data,onPostToWallcompleted); } //the return function after posting to wall function onPostToWallCompleted(response) { (response) { if (response.error) { document.getElementById("txtEcho").innerHTML=response.error.message; } else { if (response.id){ window.close(); t = setTimeout("self.close()",500); } else if (response.post_id) document.getElementById("txtEcho").innerHTML="Posted as post_id responce "+response.post_id; else document.getElementById("txtEcho").innerHTML="UnkNown Error"; } } }
var data= { caption: "scores "+score,description: "I HAVE THE POWER!!",}
以上是脚本宝典为你收集整理的php – FaceBook集成麻烦的问题全部内容,希望文章能够帮你解决php – FaceBook集成麻烦的问题所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。