phonegap facebook插件 [英] phonegap facebook plugin

查看:178
本文介绍了phonegap facebook插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用phonegap 2.4和最新的facebook插件进行项目





在此期间,您可以手动对FacebookConnectPlugin.m进行以下更改:



替换行284:

 code> NSMutableDictionary * options = [[command.arguments lastObject] mutableCopy]; 

在第310行之后添加以下内容:

  [options release]; 


I'm doing a project using phonegap 2.4 and the latest facebook plugin

https://github.com/phonegap/phonegap-facebook-plugin

my problem is with posting to the user wall feed, I'm able to authenticate the user, get all the proper events for that, etc. but when I'm try to post to a feed (I'm doing the ask for read first then write permissions sequence due a new api inside ios6 and have the publish permission for the user and also I have setup my facebook account on settings, ah and also I I'm using facebook sdk 3.1) the console just trough and error

***** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFDictionary removeObjectForKey:]: mutating method sent to immutable object'**

is trying to remove and object from and inmutable dictionary, but why? where? how to solve this?

this what my js methond is trying to do

var params = {
             method: 'feed',
             name: 'Facebook Dialogs',
             link: 'https://developers.facebook.com/docs/reference/dialogs/',
             picture: 'http://fbrell.com/f8.jpg',
             caption: 'Reference Documentation',
             description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'
   };

  FB.ui(params, function(obj) { console.log(obj); });

the error is when is calling FB.ui()

I really don't know what to do, or where I can start looking, thanks for any help!!!

解决方案

This is caused by a bug in the FacebookConnect plugin following the Cordova 2.4.0 release (which uses NSJSONSerialization, and so returned objects are now immutable).

A pull request has been made on Github which contains the fixes: https://github.com/phonegap/phonegap-facebook-plugin/pull/251

In the meantime, you could manually make the following changes to FacebookConnectPlugin.m:

Replace line 284:

NSMutableDictionary *options = [[command.arguments lastObject] mutableCopy];

Add the following after line 310:

[options release];

这篇关于phonegap facebook插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆