How can I call native ios api from cocos2d html5 with javascript binding project?

434 Views Asked by At

Can cocos2d html5 with javacript binding project for ios call ios native api? I am looking for the way to access the ios device camera, photos, etc.

2

There are 2 best solutions below

1
On

Nope. The whole point of the JS API is to have a common subset of the API that works across all platforms (on the web you can't access the camera or a photo library), with the exception of the most commonly needed features like input.

You can write the camera etc code in Objective-C. You can then expose your methods as JS bindings as needed.

0
On

You can wrap the Cocos2d-html5 project in Cordova, then use the Cordova methods to call all the native functionality you mention