Closed jsayol closed 7 years ago
Nevermind, I was making a cordova build for the browser platform so of course it detects it as Cordova.
For anyone else facing this, the correct way to build your app for the browser without Cordova is with npm run ionic:build -- --prod
and then serving the contents of the www
folder (not platform/browser/www
).
Cheers, and sorry for the noise.
P.S.: doing it this way, platform.ready()
never fires but that's expected.
What if I need to run the app with cordova?
Since there is the "mobileweb" tag, I expected that the platform.is('mobileweb')
would be true.
Is there any way to check if I'm running in the browser or is the app in the mobile?
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Ionic version: (check one with "x") [ ] 1.x [ ] 2.x [x] 3.x
I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request
Current behavior: When running a production build on the browser, checking
platform.is('cordova')
returnstrue
. That is not the case when running in development mode (for example, inionic serve
)Expected behavior: AFAIK,
platform.is('cordova')
should only return true when run in a device as a packaged app.Steps to reproduce:
ionic cordova build browser --prod
platform/browser/www
folder via a web serverRelated code: A simple AppComponent to reproduce:
Other information:
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):