Skip to main content
lostinthecloud
Participating Frequently
November 25, 2014
Question

How to package .json files for use in an ANE for iOS

  • November 25, 2014
  • 1 reply
  • 1372 views

I am creating an Adobe Native Extension (ANE) for use with iOS. The native code in the main .a library file used for the ANE depends on 3rd party frameworks which themselves depend on the definitions of JSON objects defined in several .json files. I can package the 3rd party frameworks with the ANE just fine - it's the .json files that I'm having difficulties with.

I've tried packaging the .json files into the main .a library file, although I don't know if I did it the right way.

Please help.

This topic has been closed for replies.

1 reply

Inspiring
December 3, 2014

Not sure how you're supposed to pass those JSON strings(if as filenames or as strings read from files). If as strings, you might just paste them into native source code?  Or maybe just distribute the .json file(s) separately outside of your ANE and instruct people to include them when publishing to iOS (like they would include external mp3's or whatever else). Then hopefully you could read those files from inside your ANE (checking if they are available first, if not you can throw a nice exception telling people to upload those).

jadams602
Inspiring
December 3, 2014

You can read through the resources documentation for iOS here:

http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2e74ffb4130044f3619-7ff8.html

Of particular interest is the line:

"3. It moves the resource files to the top-level directory of the application."

So not sure if you are using an ant build script or whatever to build your ANE, but as long as you place these json files into the folder with your library when you build the ANE, these will end up getting copied to the top-level directory of the application when an application is built using this ANE.

This is exactly how I include an iOS .bundle of resources along with a .a in an ANE and it works fine. Nice clean packaging when distributing the ANE too.

fmontfort974
Participating Frequently
June 28, 2018

This old post saved my day

I was looking for a way to include iOS .bundle file in my ANE...

Thank you so much !