You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Don Coleman <do...@gmail.com> on 2014/08/19 03:28:24 UTC
iOS equivalent of CordovaArgs getJSONArray() and getArrayBuffer()
Is there an iOS equivalent of Android's CordovaArgs getJSONArray() and
getArrayBuffer()?
Re: iOS equivalent of CordovaArgs getJSONArray() and getArrayBuffer()
Posted by Don Coleman <do...@gmail.com>.
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 <ag...@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 <do...@gmail.com>
> wrote:
>
> > Is there an iOS equivalent of Android's CordovaArgs getJSONArray() and
> > getArrayBuffer()?
> >
>
Re: iOS equivalent of CordovaArgs getJSONArray() and getArrayBuffer()
Posted by Andrew Grieve <ag...@chromium.org>.
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 <do...@gmail.com> wrote:
> Is there an iOS equivalent of Android's CordovaArgs getJSONArray() and
> getArrayBuffer()?
>