Quantcast
Channel: iOS and tvOS
Viewing all articles
Browse latest Browse all 10823

How to send a 'byte[]' argument in Native Plugin ??

$
0
0
Hi, I have a problem about iOS native plugin.

I wanna send byte[] value to native code.

But, I don't know how to make native method.

I make a plugin method like this.
Code (csharp):
  1.  
  2. [DllImport ("__Internal")]
  3. private static extern void _SendPhoto(byte[] data);
  4.  
Then, use like this.
Code (csharp):
  1.  
  2. Texture2D tex = new Texture2D(100, 100);
  3. tex.ReadPixels(new Rect(0, 0, 100, 100), 0, 0);
  4. byte[] buffer = tex.EncodeToPNG();
  5. _SendPhoto(buffer);
  6.  
and, how to I make native code?...

How to send a 'byte[]' argument in Native Plugin ??

Viewing all articles
Browse latest Browse all 10823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>