So, I’ve built an Ionic app with the thought that I would get my app in to the app stores. But after evaluating my app and the license terms for both app stores, I’m pretty sure my app won’t get approved. That leaves me with a ton of work put in to the Ionic app, but with probably a 90% chance that my app won’t get approved in the app store. I’d like to use the app as a mobile web app now so that I’m not throwing away all (well, a lot) of my efforts. I know Ionic isn’t really designed to run in the browser, but I’m just wondering what type of problems I might hit by trying to use it as a web app. I was thinking I would try to use some browser detection and only allow people to the mobile web app when it looks like they are browsing on their phone.
Can anyone provide any guidance on using an Ionic app as a mobile web app?
Yea you can totally do that. I’m actually stuck on a problem so I made a quick app to demonstrate it http://antonvolt.com/angtest , you just need to run it on a webserver and it just works out of the box. Then what you want to do is detect if a user is on a mobile device, the best solution is likely Device.js for you: https://github.com/borismus/device.js
That way you can make a mobile only site and regular site, device.js will help send the user to the right place depending if they are on mobile or desktop.
(Hope that helps, let me know if you have any other questions. btw, any chance you know how to take info of what a user types into a field and use it to automatically fill in another form input field in another tab/view? here’s the source for that example https://github.com/AntonVoltchok/AngTest)
Thanks for the info. I guess my main concern was all of the cordova stuff. Even the cordova.js file. I know my app works pretty well in the browser from testing, I was just concerned about any gotchas that I may not have run into yet. I’d hate to launch my mobile ionic web app only to have things go belly up because it really isn’t meant to be run as a stand alone web app.
Sorry, can help on your other question, as I’m fairly new to both Ionic and Angular in general. The only thing that pops into mind is to use $rootScope.
What’s your specific hardware functions of mobile devices (cordova) that would prevent it from working as a web app? I made a video chat ionic android app using webRTC, and I did have to change some code slightly to get same functionality in the desktop browser, but it wasn’t a huge thing.
My app uses the camera to upload pictures, uses gps, etc. Wasn’t sure I could use these through cordova or if I would have to look to use more native browser capabilities/code. Also, I’m using ng-cordova as well, so wasn’t sure if that could run in the browser directly as well.
As for rootScope, you can check the docs to get a better understanding. As I said, I’m a bit of an Angular rookie. But, the gist of it is this, each controller in your app gets it’s own scope. And that is where you would typically get/set values etc. But, there is also root scope, so as long as your in the same app, you could set something on the rootScope in one controller and access it in another. That might be enough to get you what you are looking to do.