3
votes

I'm trying to develop an iOS App using phonegap 3.0. The app uses sharekit plugin and GAPlugin for phonegap, and it was working when I was using phonegap 2.9 After the upgrade it compiles and when I try to access the functions in the plugin, it gives me this error.

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
  ]
]
3

3 Answers

8
votes

If you tru use "old" plugin in phonegap 3.0 you should write hack in native code of plugin method. For example:

- (void)register:(CDVInvokedUrlCommand*)command
{
    self.callbackId = command.callbackId;
    NSArray *arguments = command.arguments;
    NSDictionary *options = [arguments objectAtIndex:0];

instead of

- (void)register:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options
    self.callbackId = [arguments pop];
7
votes

The GAPlugin does not yet support the new Plugin signature that Phonegap introduced in 2.1.0. The old plugin signature is no longer supported in Phonegap/Cordova 3.0.0.

The new signature is:

- (void)myMethod:(CDVInvokedUrlCommand*)command; 

The GAPlugin still uses:

  • (void) initGA:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;

(see https://github.com/phonegap-build/GAPlugin/blob/master/src/ios/GAPlugin.h for more details).

The same seems to apply for the ShareKit plugin.

2
votes