0

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.

Emmy
  • 3,949
  • 5
  • 28
  • 30

2 Answers2

0

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.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
  • Thanks for your answer. Do you know how to expose the methods as JS binding? Or can I switch the scenes between cc.Scene and UIViewController ? – Emmy Jan 25 '14 at 01:28
0

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

Ravi Purushotma
  • 125
  • 1
  • 6