Facebook更新用户状态

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Facebook更新用户状态相关的知识,希望对你有一定的参考价值。

Update a user's status using the Facebook Actionscript API
  1. //note that the current class aka this extends FacebookSessionUtil
  2. //initial call checks to see if user has permission to update status
  3. private function postToStatus():void {
  4. var call:FacebookCall = facebook.post(new HasAppPermission(ExtendedPermissionValues.STATUS_UPDATE,userId));
  5. call.addEventListener(FacebookEvent.COMPLETE, onStatPermission);
  6. }
  7. //if success update -> update status else -> grant permissions (opens a new window in browser)
  8. private function onStatPermission(e:FacebookEvent):void {
  9. if (e.success && (e.data as BooleanResultData).value) {
  10. publishStat();
  11. }else {
  12. this.facebook.grantExtendedPermission(ExtendedPermissionValues.STATUS_UPDATE);
  13. }
  14. e.currentTarget.removeEventListener(FacebookEvent.COMPLETE, arguments.callee);
  15. }
  16. //sets the status to a string defined by the user//
  17. private function publishStat():void {
  18. var statcall:FacebookCall = this.facebook.post(new SetStatus(/*insert a string*/));
  19. statcall.addEventListener(FacebookEvent.COMPLETE, onStatPublish);
  20. }
  21.  
  22. //let the user know it has been published
  23. private function onStatPublish(e:FacebookEvent):void {
  24.  
  25. if (e.success) {
  26. //alert user status has been published
  27.  
  28. }else {
  29. trace(e.error.rawResult);
  30. }
  31. e.currentTarget.removeEventListener(FacebookEvent.COMPLETE, arguments.callee);
  32. }

以上是关于Facebook更新用户状态的主要内容,如果未能解决你的问题,请参考以下文章

ActionScript 3 Facebook更新用户状态

Facebook更新用户状态

通过 Iphone SDK 发布 Facebook 状态更新和 url

阅读 Facebook 用户的状态更新需要 iOS 上的 read_mailbox 权限

来自 C# Windows 服务的 Facebook 状态更新

从 iPhone 将音频文件作为状态更新发布到 Facebook