Moh*_*sil 3 iphone objective-c ios cordova
我正在尝试使用phonegap 3.0开发iOS应用程序.该应用程序使用sharekit插件和GAPlugin的phonegap,当我使用phonegap时它正在工作2.9升级后它编译,当我尝试访问插件中的功能时,它给了我这个错误.
ERROR: Method 'share:' not defined in Plugin 'ShareKitPlugin'
2013-07-22 22:05:06.976 -[CDVCommandQueue executePending] [Line 116] FAILED pluginJSON = [
"INVALID",
"ShareKitPlugin",
"share",
[
"test",
"http:\/\/www.test.com"
]
]
ERROR: Method 'initGA:' not defined in Plugin 'GAPlugin'
2013-07-22 22:05:06.977 -[CDVCommandQueue executePending] [Line 116] FAILED pluginJSON = [
"GAPlugin1900170756",
"GAPlugin",
"initGA",
[
"UA-XXXXXX-11",
10
]
]
小智 8
如果你在phonegap 3.0中使用"旧"插件,你应该在插件方法的本机代码中编写hack.例如:
- (void)register:(CDVInvokedUrlCommand*)command
{
self.callbackId = command.callbackId;
NSArray *arguments = command.arguments;
NSDictionary *options = [arguments objectAtIndex:0];
Run Code Online (Sandbox Code Playgroud)
代替
- (void)register:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options
self.callbackId = [arguments pop];
Run Code Online (Sandbox Code Playgroud)
小智 7
GAPlugin还不支持Phonegap在2.1.0中引入的新插件签名.Phonegap/Cordova 3.0.0不再支持旧的插件签名.
新签名是:
- (void)myMethod:(CDVInvokedUrlCommand*)command;
Run Code Online (Sandbox Code Playgroud)
GAPlugin仍然使用:
(有关详细信息,请参阅https://github.com/phonegap-build/GAPlugin/blob/master/src/ios/GAPlugin.h).
同样似乎适用于ShareKit插件.
| 归档时间: |
|
| 查看次数: |
4091 次 |
| 最近记录: |