cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Don Coleman <don.cole...@gmail.com>
Subject Re: iOS equivalent of CordovaArgs getJSONArray() and getArrayBuffer()
Date Tue, 19 Aug 2014 16:25:29 GMT
Sending data back in the PluginResult works well.
Apparently for incoming data, I can just assign it to the proper type.

     NSArray *serviceUUIDStrings = [command.arguments objectAtIndex:0]; //
JSON list of UUID strings

     NSData *characteristicValue = [command.arguments objectAtIndex:3]; //
JavaScript Uint8Array


On Tue, Aug 19, 2014 at 10:01 AM, Andrew Grieve <agrieve@chromium.org>
wrote:

> I think on iOS any ArrayBuffers come through as NSData*, as long as they
> are in the top-level exec() arguments (not nested within an object).
> There's also:
>     [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
> messageAsArrayBuffer:data]
> and:
>      [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
> messageAsMultipart:arr]
>
> Which lets you send back either a single NSData*, or the latter an array
> where each element can be a NSData (or other supported arg type)
>
>
>
>
> On Mon, Aug 18, 2014 at 9:28 PM, Don Coleman <don.coleman@gmail.com>
> wrote:
>
> > Is there an iOS equivalent of Android's CordovaArgs getJSONArray() and
> > getArrayBuffer()?
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message