phonegap/phonegap-plugins — Issue #189: PhoneGap iOS : Check Camera Availability
Author: amitbattan
Created: 2011-10-21 12:33:28+00:00
State: open

I am using phonegap for one of my application.
I have a issue. I want to know my device has camera or not.
Like apple device has iPad1 and old iPod has no camera.
I want to disable the button of capture.

Is any way to do the same?
Device plugin of phonegap should return the cameraAvailability too.

I try to make a plugin for it.
I want to use a property for it, like window.device.cameraAvalibale.
I try to set "Device.prototype.cameraAvailable" in my new plugin.
But in this I have a another issue that plugin native function callback the javascript after deviceready.
So the property return wrong value.
I don't want to use any callback js for it.

Can you suggest me to resolve this issue.
Should I edit the Device plugin.
OR
Make a new plugin and use it callbackreturn for disable the capture button

Can we make (NSString) return type in Objective C plugin
like -(NSString *)function:(NSMutableArray)arguments withDict:(NSMutableDictionary*)options