I have implemented a camera functionality in an ionic-angular based application.I am getting an error Camera is not defined.The above mentioned error is occurring when I am using the command ionic serve.The issue doesn't exist when command ionic browser is used.Also getting the same error Camera is not defined when I deployed the app to firebase.Any suggestions for steps I need to follow while deploying the app to firebase to avoid the error ?
Below is the behavior I could see.
I used the command ionic serve.
The Camera plugin doesn't loads in browser view and I could see the following error.
Error from browser
On using the command ionic run browser,Could see camera getting loaded.This is browser view.ionic run browser
This application is deployed using firebase deploy command and hosted in a firebase environment.I could see the same behavior ie(Camera not loading) when accessed the url through an android phone(Moto X Play). Is this expected?.Do I need to execute some other steps while deploying my application to firebase.
Also I have included the ngCordova dependencies in my app.js and included the cordova.js just before ng-cordova.js in my index.html.Currently this app is not installed in playstore or Apple app store.This application is developed in ionic and can be viewed in mobile device by accessing firebase hosting url in which the application is deployed.
Camera plugin is a cordova plugin.and some cordova plugins doesn't support in browser. so install your app into mobile, it will work fine.
Related
I've built an app using React js and built that as an ipa file (the target devices are iPads) using Ionic AppFlow. This app utilises a google drive connection to create folders and upload files, which I've tested while running through both npm start and ionic serve and have been able to verify that the google drive authentication and functionality work as intended when run on Chrome on Windows and Safari on both mac OS and iOS. Post-build, I get an error that reads that me.a.client.drive is undefined, with that error being consistent regardless of if I'm using import { gapi } from 'gapi-script' or loading it (through the same npm module) to load gapi as part of the window using the loadGapiInsideDOM function. Is there something I'm missing about how to set up a functional google drive client using this setup? Thanks!
Technologies used
I have a TODO app developed in Gatsby, using Firebase Firestore to store the data and read from it
I have used gatsby-starter-capacitor project as a starter template. Why? I want my app to run both on iOS and Android.
What I have right now?
My local build when using npx gatsby develop, I can see the site I have created. I have successfully deployed my app to Netlify as well.
Also, I can run my app on iOS device, I did npm run build && npx cap copy ios && npx cap open ios
For Firebase, I have created a web app in my Firebase console, and used the details on my Gatsby App template. The Firebase details for the WebApp, e.g. Keys and etc, are in a .env file, which I have declared and uploaded on Netlify Environment Variables section
This launches my app on my iPhone - Fantastic.
Localhost: I can save and read data from Firebase and can see the data appearing saved on Firebase console. (Awesome)
Problem
App on iPhone/Netlify loads on a fresh slate, the data is not read from Firebase.
How do I productionise my app so my friends can use it when I release it in Appstore. Because, currently when my app runs on an iOS device, it is running on its localhost? or something that I am not sure of. My app is already running on Netlify, how do I connect this iOS project to go to that URL?
Basically, I want users to be able use this app and read/write to Firebase (which currently works on localhost).
I have made a simple android app using ionic and AngularJs and I run this app then it works in a a browser while I run app in Emulator then it is not working.So I want to find issue what is reason that it is not working so for this purpose I want to do testing and debugging
I have made a simple android app using Ionic and AngularJS and whenI run this app then it works in a browser while I run this app in Emulator then it is not working.
Please tell me how can I test and debug in a chrome for android app.And also tell me detail with step.
You can build the app in debug mode and then connect your computer to your Android phone that you want to test the app. After that, you install the app via the .apk that you just generated then start the app. Now that your app is running in your phone that is connected to your computer, you can debug via Google Chrome by inspecting it. Here is how to do so in details.
I have an ionic 3 app. It builds and runs on Android and iOS as expected. Usually the app can be tested in a browser by executing ionic serve shell command and then navigating to http://localhost:8100/ URL in the browser.
But is there a way to deploy this ionic app to a web browser as a platform, so it could be later deployed to a web server and be publicly available?
You can add browser as a platform, then build it and copy the /www folder on your webserver.
ionic platform add browser (or if using ionic-cli v3 ionic cordova platform add browser)
ionic build browser --prod (or if using ionic-cli v3 ionic cordova build browser --prod)
Copy files from the /www folder to your webservers root directory.
I have a webapp which I build with Angularjs 2.0, I want to convert it to android apk and install it on android phone and test.
I dont have any experience in building mobile native app or converting webapp to native app.
I have gone through How to convert an existing AngularJS web app to a Cordova app?
Any suggestion/guidance will be helpful.
The most simple explanation is you will need to put your angular files in the www folder, setup your configuration file, make sure the android platform is installed, then run the Android emulate and/or build command to see if it works. That's a very oversimplified version.
Once you've got it working there's a process to go through to prepare the apk to be uploaded to the Google Play Store. You have to be a registered developer for the play store, which is $25/year.
https://scotch.io/#vijayk036/building-hybrid-mobile-apps-using-cordova-and-angularjs-for-android
https://thebhwgroup.com/blog/converting-angularjs-website-cordova-app-ios-and-android