Can't access camera PhoneGap 3.3 - ios

The Problem
I'm attempting to build my first PhoneGap app for iOS. I am using version 3.3.x.
For whatever reason, I can't seem to get the Camera feature to work on my iPhone 5S (haven't tested any other devices).
What I've tried
I've installed the Camera Plugin
I've added the feature to the config.xml file on the platform/ios/www level.
I've tried using PhoneGap docs examples.
I've tried using other online examples.
I've tried buying the PhoneGap 3 book and going step-by-step through their method.
None of that seems to matter
What works
I've used a <input type="file" accept="image/*;capture=camera">, this works, but it's not really what I'm looking for. I'm trying to actually access the Camera API.
Geolocation plugin I've tried and it works fine.
Accessing external API's I have gotten to work.
What also doesn't work
Contacts Plugin also doesn't seem to be working with the examples on the PhoneGap Docs.
Possible Clues
I am running / building the app from within Xcode. I've also tried building using the Command-Line Tool but I'm not sure how to run it on my iPhone once it's been built through CLT. I don't know if this matters or not.
There seems to be a "lag" in launch time when I include any scripts associated with the Camera API.
Since I've used so many different code snippets from verified sources, I doubt it has to do with the js, html or css that I'm writing. I believe this to be a dependency issue, but I have no idea what it could be, and there's not much help out there for PhoneGap yet.
Any advice or suggestions would be greatly appreciated!

Related

CanvasCamera for iOS PhoneGap / Cordova

First of all, I'm really new to Cordova and Xcode and I'm trying to create an inline QR Code scanner from and HTML 5 app (or at least see if it's possible with this plugin).
I'm trying to follow the instructions from https://github.com/daraosn/Cordova-CanvasCamera and I am unsure what format or how to edit the config.xml in my project.
The instructions say:
"Edit your config.xml and add CanvasCamera into your Plugins list." but i dont know what this means or what format it should follow.
Also, when I add the plugins to the Plugin folder in the project, Xcode throws an error saying:
"'NSAutoreleasePool' is unavailable: not available in automatic reference counting mode".
I know that getUserMedia isnt support in Safari/iOS so it's pushing the boundaries a bit. If all else fails, i'll just use the input type=file and access the camera that way.
That plugin you reference looks severely dated. My best guess is, for your config.xml, add:
<plugin name="CanvasCamera" />
once you copied the files into your directory per those instructions.
Also, you could check out https://github.com/donaldp24/CanvasCameraPlugin. You can install it by running "cordova plugin add https://github.com/donaldp24/CanvasCameraPlugin.git && cordova prepare".
Hope this helps.
I found a plugin (http://scandit.com) which is much better than what i was originally trying to achieve.
The only downside is that it's a premium service ($200/month), however the upsides are: super easy to install, is really really fast at decoding (doesn't need to focus, shade doesn't matter), available on plenty for platforms, good documentation.
Another point was that it is a fullscreen camera plugin, which actually works better than inline, what we initially wanted.
Hope it helps anyone else.

lungojs in trigger.io

Hi I am looking for using Trigger.io to create mobile app but use the Lungojs for the GUI part. I am unable to find reference of using these two without any issues . would like to hear from some with experience .
I'm interested in Lungo too, so thought the best way would be to try it.
I took the Lungo JS example app from https://github.com/TapQuo/Lungo.js/tree/master/example
Put it into the /src folder of a default Trigger.io project and built it for Android without any problems. Tested it on an Android 4.1 device and it works great. :)
The built kitchen sink app is available here: https://dl.dropbox.com/u/579708/android/lungojs/lungojskitchensink21.apk

phonegap 2.0 with admob/iads

I've been searching for hours for a guide/tutorial on how to implement either admob or iads in an iOS app build with PhoneGap 2.0. So far I've been searching in vain. The closest I have gotten to an answer is this:
http://iphone.keyvisuals.com/iphonedev/implementing-admob-ads-in-a-phonegap-project-for-ios-no-plugins-required/
I dont have any objective-c experience and in the above mentioned link I can get past 3rd step. I have tried to download the demo and look at the code, but the app can't even be built. Probably because I'm using PhoneGap 2.0 and not an older version.
Are any of you guys able to guide me, or know of any helpful links for this to succeed?
How about using this plugin from github? Looks like getting it setup shouldn't be too bad.

Phonegap and iPhone apps

I want to build an iPhone app, but I only know PHP, JavaScript, CSS and HTML. I heard that I can use Phonegap to build the app in javascript and it converts the JavaScript to Objective-C. Is that true? The phone gap documentation was hard to understand. What other solutions do I have?
Yes and no.
Phonegap (nowadays known as Apache Cordova) enables you to bundle web pages/applications as native phone apps. It also provides you with some JavaScript bindings to native phone APIs that you otherwise wouldn't be able to access (=with a plain webpage). These bindings include (just to name a few) Accelerometer, Camera and Compass. That's pretty much all it does - you still have to figure out how to write your application with JavaScript, HTML and CSS.
Try out how it works by checking out "Getting Started with iOS".
If you know all these languages you mentioned that is well enough for developing an iOS App(as well as you can develop the same apps in Android).
I would suggest you to go for PhoneGap(Cordova) framework to develop these apps. Using this framework you'll have to use HTML/HTML5, JavaScript, CSS, PHP and get the iOS App running on your device. Here to StartWith and then check out APIDocs. You will always get a lot of tutorials on google itself.
You can also refer This Question for gathering some knowledge about other frameworks available in market.
Hope it helps.
I would suggest Phonegap, but you can't use PHP with Phonegap apps directly... There are a few hacks around this though.
Although Phonegap is supposed to be "one codebase, distribute everywhere", if you want a really great looking app you'll have to spend a liitle time adjusting the UX for every platform or device. The thing I really like about Phonegap is that you can open up a HTML page locally on your browser and move thing around in firebug, making the process faster.

Integrating phoneGap with native iOS app

i'm trying to create an app which uses the combination of native functionality and the phoneGap framework. The native app has a button, upon the click of which the phoneGap ui has to be added to the view. Is there any way to achieve this? Are there any tutorials for the same?
Yes, this is possible. Although you might be getting yourself into some headaches. My app kind of goes the other way around, it's mostly phonegap, but occasionally i'll pop open a view that is native. Here is the link to code that shows an excellent example of how to switch between the iOS and phonegap worlds.
new updated recommended article (see update below)
These files represent a standard plugin used in phonegap. In this particular plugin, a native view is opened on top of a phonegap view. Notice you have a custom xib and everything. This plugin can be modified to display any xib with any functionality you could think of.
If you implement this plugin you will easily see how to jump back and forth. I've successfully heavily modified these classes to add LOTS of native capabilities to my phonegap project. Also you should probably check out the official phonegap guide to phonegap plugins. Here
Important Edit
Was informed original linkwas broken (not terribly surprised as this answer is very old and i've long since moved away from Phonegap) so I replaced the original link with an article that shows how to do these plugins well. In the article it explains the link is broken and gives several links where these older files are maintained, but in fact those are broken as well. Here is a branch of one of them I found that still hosts the original files on an "archive" branch. But I haven't investigated whether these files are wildly different from my original work. Good luck!
That's not how Phonegap is meant to be used.
To achieve what you are asking for you just need to create a Phonegap app and add the extra native functionality by writing a Phonegap plugin in Objective-C. You may add as much native code as you want.
I'm actually wanting to do the same thing as the original poster. Theoretically it would be comparatively easy, but non-trival to do. I'd love it if there was a PhoneGapView that one could integrate into an existing project. Bonus points if said PhoneGapView could be integrated in Interface Builder as a re-sizeable and re-positional object, basically think of it as an Object that extends UIWebView.
This is wishful thinking on my part seeing as this is how the higher-ups want my project.

Resources