Facebook更新用户状态
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Facebook更新用户状态相关的知识,希望对你有一定的参考价值。
Update a user's status using the Facebook Actionscript API
//note that the current class aka this extends FacebookSessionUtil //initial call checks to see if user has permission to update status private function postToStatus():void { var call:FacebookCall = facebook.post(new HasAppPermission(ExtendedPermissionValues.STATUS_UPDATE,userId)); call.addEventListener(FacebookEvent.COMPLETE, onStatPermission); } //if success update -> update status else -> grant permissions (opens a new window in browser) private function onStatPermission(e:FacebookEvent):void { if (e.success && (e.data as BooleanResultData).value) { publishStat(); }else { this.facebook.grantExtendedPermission(ExtendedPermissionValues.STATUS_UPDATE); } e.currentTarget.removeEventListener(FacebookEvent.COMPLETE, arguments.callee); } //sets the status to a string defined by the user// private function publishStat():void { var statcall:FacebookCall = this.facebook.post(new SetStatus(/*insert a string*/)); statcall.addEventListener(FacebookEvent.COMPLETE, onStatPublish); } //let the user know it has been published private function onStatPublish(e:FacebookEvent):void { if (e.success) { //alert user status has been published }else { trace(e.error.rawResult); } e.currentTarget.removeEventListener(FacebookEvent.COMPLETE, arguments.callee); }
以上是关于Facebook更新用户状态的主要内容,如果未能解决你的问题,请参考以下文章
通过 Iphone SDK 发布 Facebook 状态更新和 url
阅读 Facebook 用户的状态更新需要 iOS 上的 read_mailbox 权限