[SOLVED] Device.cordova false from within Android app


#1

I am using an app created with the cli (framework7 create --ui). I have

  • vue
  • types: [pwa, cordova]

I can successfully build and run an app in my android device (running build-cordova-android-dev), but in my onPageInit callback, I get
this.$f7.device.android == true but
this.$f7.device.cordova == false

I do not know if this can help, but I do not see any import of cordova.js in my cordova/www/index.html file


#2

What is in your /src/index.html?


#3

Here what I have: pen


#4

I think I found the problem. My index.html is missing this section

<% if (process.env.TARGET === 'cordova') { %>
    <script src="cordova.js"></script>
<% } %>

With this line, cordova is there. In my imagination, webpack was doing all the job…I was too imaginative


#5

See here too: [SOLVED] Cordova Plugins with Framework7 + Vue?