Can I check a list of successfully loaded plugins from within a cordova app? such as camera, geolocation, barcodescanner, etc
The cordova object should have a plugins property (cordova.plugins) ?
If I call cordova.plugins the script returns undefined
Related
We are building hybrid app using ionic 5, one of the requirement is to open the HTML files downloaded to the local app content folder. The HTML files has reference to js & css files. The difficulty we face is the HTML file opens successfully and the javascript & CSS reerred is not opening. we tried using inappbrowser, window.open, previewanyfule plugin most of them same result. need guidance in opening such files.
If you wish to run your ionic app on an android or iOS device you will need Cordova or capacitor.
I'm trying to embed Cordova in my native iOS application. I only need a tiny part of my application to use cordova. From now I managed to show a CordovaViewController with some HTML in there, but I can't find out how to add cordova plugins (ex. cordova-plugin-network-information) in the project.
I installed it using cocoapods, but I can't find in the Cordova's documentation how to wire it up with my www folder so that navigator.connection would not be undefined
Thank you for your help!
Im using
window.resolveLocalFileSystemURL(cordova.file.dataDirectory,function(root){},err);
But I'm unable to get all the files. Camera files are also not accessible.
How to resolve ?
In iOS, we cannot access the all files using cordova file plugin whereas Android has support for accessing files form externalRootDirectory. Specific to iOS its better to use imagePicker, audioPicker plugins to access camera files.
I am not using cli for my cordova project ,i got the cordova 3.5.0 project from there site and integrated with my project.All the custom plugins created by me is working fine.But the API's like device is not accessible.I have added the CDVDevice to config.xml but still i can't able to access the device object.
So please help me to solve this problem.
In order to correctly working the Cordova requires you to have cordova_plugins.js file near the cordova.js. That file contains registration of the JS API.
The easiest part is use Plugman to install plugins inside your custom project, that way, it will handle all work on creation of cordova_plugins.js.
Official Cordova documentation for the Plugman
See the possible related answer Cordova 3.5 embedded webview with plugins where I put more insights about how you could modify cordova_plugins.js in case you desperately need this, but I would recommend you to use Plugman.
I've installed Phonegap using the npm and my app is working great, except when I call window.open to launch a website it does not give me the footer with the done button so my app get's stuck on the called web page.
I am using XCode to build an ios app.
I've used npm to add the InAppBrowser plugin. It added the to to the config.xml.
I've added the site to my whitelist in config.xml. The site opens fine, just without the done button/footer.
It added the InAppBrowser plugin entry to:
/#myapp#/platforms/#platform#/www/cordova_plugins.js
It added the InAppBrowser plugin folder in /#myapp#/platforms/#platform#/plugins/
The related SRC files for InAppBrowser are in the platform folder as well
(for example IOS plugin src files are: /#myapp#/platforms/#platform#/#appname#/Plugins/)
I added a console.log function to InAppBrowser.js to confirm that the plugin is loaded, but it does not generate a log entry.
I've tried many things to get the footer/done button to show without any success, but I seem to be missing something here.
I solved this problem by recreating the Xcode project using cordova (instead of phonegap). I went through all of the solutions several times with no luck, so I used the terminal to build a new cordova project, added the InAppBrowser to the project, then copied my code and assets from the old project to the new one. Launched the app on my ipad and it all worked just fine.
I don't suspect it's a problem with Phonegap 3.1.0. I think there was a project issue that kept it from working and starting over with a clean project did the trick.
All is well.
One note is that I saw postings that reported cordova interrupts the console.log function, so be careful with that. Alerts work just fine.